lib/destiny_rb/item_explorer.rb
# Explorer Bucket definitions
#
# Usage:
#   client.buckets(:artifact)
#   client.buckets(1)
#
# Arguments:
#   type: (String/Symbol)
#
# Returns:
#   Either the numeric representation of a explorer bucket or a symbol of said bucket.


(String/Symbol)

Either the numeric representation of a explorer bucket or a symbol of said bucket.
( String / Symbol ) Either the numeric representation of a explorer bucket or a symbol of said bucket .
def buckets(type)
      types = {
        none: 0,
        artifact: 1,
        materials: 2,
        consumables: 4,
        mission: 8,
        bounties: 16,
        build: 32,
        primary_weapon: 64,
        special_weapon: 128,
        heavy_weapon: 256,
        head: 512,
        arms: 1024,
        chest: 2048,
        legs: 4096,
        class_items: 8192,
        ghost: 16384,
        vehicle: 32768,
        ship: 65536,
        shader: 131072,
        emblem: 262144
        }
      if type.is_a? Numeric
          requested_type = types.key(type) || :none
      else type.is_a? Symbol
          requested_type = types.fetch(type, 0) 
      end
    end
def buckets ( type ) types = { none : 0 , artifact : 1 , materials : 2 , consumables : 4 , mission : 8 , bounties : 16 , build : 32 , primary_weapon : 64 , special_weapon : 128 , heavy_weapon : 256 , head : 512 , arms : 1024 , chest : 2048 , legs : 4096 , class_items : 8192 , ghost : 16384 , vehicle : 32768 , ship : 65536 , shader : 131072 , emblem : 262144 } if type . is_a? Numeric requested_type = types . key ( type ) || :none else type . is_a? Symbol requested_type = types . fetch ( type , 0 ) end end
Explorer Bucket definitions
Usage:
client.buckets(:artifact)
client.buckets(1)
Explorer Bucket definitions Usage : client . buckets ( : artifact ) client . buckets ( 1 )
# Fetch type from hash, if type doesn't match return 'none' # Fetch type from hash, if type doesn't match return 0 for 'none'
type
<not_specific>