Class: WoW::AuctionData
- Inherits:
-
Object
- Object
- WoW::AuctionData
- Includes:
- HTTParty
- Defined in:
- lib/wow/features/auction_data.rb
Instance Attribute Summary collapse
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(server, params = {}) ⇒ AuctionData
constructor
A new instance of AuctionData.
Constructor Details
#initialize(server, params = {}) ⇒ AuctionData
Returns a new instance of AuctionData.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/wow/features/auction_data.rb', line 8 def initialize(server, params = {}) response = self.class.data(server, params) # Only use the first file for now... file = response["files"][0] @server = server @last_modified = Time.at(file["lastModified"].to_i / 1000) @url = file["url"] end |
Instance Attribute Details
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
6 7 8 |
# File 'lib/wow/features/auction_data.rb', line 6 def last_modified @last_modified end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
6 7 8 |
# File 'lib/wow/features/auction_data.rb', line 6 def server @server end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/wow/features/auction_data.rb', line 6 def url @url end |
Class Method Details
Instance Method Details
#data ⇒ Object
19 20 21 |
# File 'lib/wow/features/auction_data.rb', line 19 def data HTTParty.get(@url).parsed_response end |