class BackpackTF::Currency
ruby representations of a JSON response to ‘IGetCurrencies`
Constants
- INTERFACE
Class Methods
Attributes
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]
@return [Symbol] either :Craftable or :Non-Craftable to signify currency’s craftability
@return [Fixnum] the definition index of the currency
@return [String] the plural form of noun that is used in the suffix
@return [Fixnum] the internal priceindex of the currency
@return [Fixnum] the quality index of the currency
@return [Fixnum] the number of decimal places the price should be rounded to
@return [String] the single form of noun that is used in the suffix
@return [Symbol] either :Tradable or :Non-Tradable to signify currency’s tradability
Public Class Methods
# 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
# 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
# File lib/backpack_tf/currency.rb, line 16 def self.response @response = superclass.responses[to_sym] end