Class: BackpackTF::UserListing
- Defined in:
- lib/backpack_tf/user_listing.rb
Constant Summary collapse
- INTERFACE =
:IGetUserListings
- @@listings =
[]
Instance Attribute Summary collapse
-
#bump ⇒ Object
readonly
Returns the value of attribute bump.
-
#buyout ⇒ Object
readonly
Returns the value of attribute buyout.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#currencies ⇒ Object
readonly
Returns the value of attribute currencies.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attr) ⇒ UserListing
constructor
A new instance of UserListing.
Methods inherited from Response
hash_keys_to_sym, responses, to_sym
Constructor Details
#initialize(attr) ⇒ UserListing
Returns a new instance of UserListing.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/backpack_tf/user_listing.rb', line 33 def initialize attr attr = check_attr_keys(attr) @id = attr[:id].to_sym @bump = attr[:bump] @created = attr[:created] @currencies = attr[:currencies] @item = set_keys_of_key_to_symbols(attr[:item], 'attributes') @details = attr[:details] @meta = self.class.hash_keys_to_sym(attr[:meta]) @buyout = attr[:buyout] end |
Instance Attribute Details
#bump ⇒ Object (readonly)
Returns the value of attribute bump.
25 26 27 |
# File 'lib/backpack_tf/user_listing.rb', line 25 def bump @bump end |
#buyout ⇒ Object (readonly)
Returns the value of attribute buyout.
31 32 33 |
# File 'lib/backpack_tf/user_listing.rb', line 31 def buyout @buyout end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
26 27 28 |
# File 'lib/backpack_tf/user_listing.rb', line 26 def created @created end |
#currencies ⇒ Object (readonly)
Returns the value of attribute currencies.
27 28 29 |
# File 'lib/backpack_tf/user_listing.rb', line 27 def currencies @currencies end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
29 30 31 |
# File 'lib/backpack_tf/user_listing.rb', line 29 def details @details end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
24 25 26 |
# File 'lib/backpack_tf/user_listing.rb', line 24 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
28 29 30 |
# File 'lib/backpack_tf/user_listing.rb', line 28 def item @item end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
30 31 32 |
# File 'lib/backpack_tf/user_listing.rb', line 30 def @meta end |
Class Method Details
.interface ⇒ Object
10 |
# File 'lib/backpack_tf/user_listing.rb', line 10 def self.interface; @interface; end |
.listings ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/backpack_tf/user_listing.rb', line 16 def self.listings return @response if response.nil? @@listings = response[:listings].inject([]) do |listings, attr| listings << new(attr) listings end end |
.response ⇒ Object
12 13 14 |
# File 'lib/backpack_tf/user_listing.rb', line 12 def self.response @response = superclass.responses[to_sym] end |