class BackpackTF::Currency

ruby representations of a JSON response to ‘IGetCurrencies`

Constants

INTERFACE

Class Methods

Attributes

blanket[R]

TODO: what does the :blanket attribute mean? it is set to 0 by default. However, it is set to 1 for :hat. :hat also has an extra property & value :blanket_name => ‘Random Craft Hat’ @return [Fixnum]

craftable[R]

@return [Symbol] either :Craftable or :Non-Craftable to signify currency’s craftability

defindex[R]

@return [Fixnum] the definition index of the currency

plural[R]

@return [String] the plural form of noun that is used in the suffix

priceindex[R]

@return [Fixnum] the internal priceindex of the currency

quality[R]

@return [Fixnum] the quality index of the currency

round[R]

@return [Fixnum] the number of decimal places the price should be rounded to

single[R]

@return [String] the single form of noun that is used in the suffix

tradable[R]

@return [Symbol] either :Tradable or :Non-Tradable to signify currency’s tradability

Public Class Methods

currencies() click to toggle source
# File lib/backpack_tf/currency.rb, line 20
def self.currencies
  return @response if @response.nil?
  @@currencies = response[:currencies]
  hash_keys_to_sym(@@currencies)
end
new(name, attr) click to toggle source
# File lib/backpack_tf/currency.rb, line 52
def initialize name, attr
  attr = check_attr_keys(attr)

  @name       = name.to_s
  @quality    = attr[:quality]
  @priceindex = attr[:priceindex]
  @single     = attr[:single]
  @plural     = attr[:plural]
  @round      = attr[:round]
  @craftable  = attr[:craftable].to_sym
  @tradable   = attr[:tradable].to_sym
  @defindex   = attr[:defindex]
  @blanket    = attr[:blanket]
end
response() click to toggle source
# File lib/backpack_tf/currency.rb, line 16
def self.response
  @response = superclass.responses[to_sym]
end