Class: Halo::APIResponse
- Inherits:
-
Object
- Object
- Halo::APIResponse
- Defined in:
- lib/halo-api/api_response.rb
Direct Known Subclasses
Halo5::Metadata, Halo5::Profile, Halo5::Stats, Halo5::Ugc, HaloWars2::Metadata, HaloWars2::Stats
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/halo-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/halo-api/api_response.rb', line 4 def data @data end |
Instance Method Details
#get_data(path, options) ⇒ Object
11 12 13 14 15 |
# File 'lib/halo-api/api_response.rb', line 11 def get_data(path, ) return if @client.nil? response = @client.get(path, ) @data = response.parsed_response end |