Class: Battlenet::APIResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/battlenet/api/api_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options={})
  @data           = []
  @client         = options[:client]
end

Instance Attribute Details

#dataObject

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, options)
  unless @client.nil?
    response = @client.get(path, options)
    @data = response.parsed_response
  end
end