Class: HearthstoneCardApi::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/hearthstone_card_api/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_response) ⇒ Data

Returns a new instance of Data.



5
6
7
8
9
# File 'lib/hearthstone_card_api/data.rb', line 5

def initialize(api_response)
  @objs = []
  @data = api_response
  @format = HearthstoneCardApi.data_format
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/hearthstone_card_api/data.rb', line 3

def data
  @data
end

#formatObject (readonly)

Returns the value of attribute format.



3
4
5
# File 'lib/hearthstone_card_api/data.rb', line 3

def format
  @format
end

#objsObject (readonly)

Returns the value of attribute objs.



3
4
5
# File 'lib/hearthstone_card_api/data.rb', line 3

def objs
  @objs
end

Instance Method Details

#formattedObject



11
12
13
# File 'lib/hearthstone_card_api/data.rb', line 11

def formatted
  return self.send("return_#{format}", data)
end