lib/destiny_rb/item_explorer.rb
# Item Explorer Ordering definitions
#
# Usage:
#   client.order(:rarity)
#   client.enemy_race(3)
#
# Arguments:
#   type: (String/Symbol)
#
# Returns:
#   Either the numeric representation of a item ordering or a symbol of said ordering.


(String/Symbol)

Either the numeric representation of a item ordering or a symbol of said ordering.
( String / Symbol ) Either the numeric representation of a item ordering or a symbol of said ordering .
def order(type)
      types = {
        none: 0,
        name: 1,
        item_type: 2,
        rarity: 3,
        item_type_name: 4,
        item_stat_hash: 5,
        minimum_required_level: 6,
        maximum_required_level: 7
        }
      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 order ( type ) types = { none : 0 , name : 1 , item_type : 2 , rarity : 3 , item_type_name : 4 , item_stat_hash : 5 , minimum_required_level : 6 , maximum_required_level : 7 } if type . is_a? Numeric requested_type = types . key ( type ) || :none else type . is_a? Symbol requested_type = types . fetch ( type , 0 ) end end
Item Explorer Ordering definitions
Usage:
client.order(:rarity)
client.enemy_race(3)
Item Explorer Ordering definitions Usage : client . order ( : rarity ) client . enemy_race ( 3 )
# 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>