Class: Battlenet::APIResponse
- Inherits:
-
Object
- Object
- Battlenet::APIResponse
- Defined in:
- lib/battlenet/api/api_response.rb
Direct Known Subclasses
WOW::Achievement, WOW::Auction, WOW::Character, WOW::Data, WOW::Guild, WOW::Item, WOW::ItemSet, WOW::PVPLeaderboard, WOW::Quest, WOW::Realm, WOW::Recipe, WOW::Spell
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #get_data(path, options) ⇒ Object
-
#initialize(options = {}) ⇒ APIResponse
constructor
A new instance of APIResponse.
Constructor Details
#initialize(options = {}) ⇒ APIResponse
Returns a new instance of APIResponse.
6 7 8 9 |
# File 'lib/battlenet/api/api_response.rb', line 6 def initialize(={}) @data = [] @client = [:client] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/battlenet/api/api_response.rb', line 4 def data @data end |
Instance Method Details
#get_data(path, options) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/battlenet/api/api_response.rb', line 11 def get_data(path, ) unless @client.nil? response = @client.get(path, ) @data = response.parsed_response end end |