Class: HearthstoneCardApi::Data
- Inherits:
-
Object
- Object
- HearthstoneCardApi::Data
- Defined in:
- lib/hearthstone_card_api/data.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#objs ⇒ Object
readonly
Returns the value of attribute objs.
Instance Method Summary collapse
- #formatted ⇒ Object
-
#initialize(api_response) ⇒ Data
constructor
A new instance of Data.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/hearthstone_card_api/data.rb', line 3 def data @data end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
3 4 5 |
# File 'lib/hearthstone_card_api/data.rb', line 3 def format @format end |
#objs ⇒ Object (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
#formatted ⇒ Object
11 12 13 |
# File 'lib/hearthstone_card_api/data.rb', line 11 def formatted return self.send("return_#{format}", data) end |