Class: Amazonian::Item
- Inherits:
-
Object
- Object
- Amazonian::Item
- Defined in:
- lib/amazonian.rb
Overview
Item
The Item class is used to neatly box up the Amazon REST API responses into an Object.
A Hashie::Mash is used for the internal data representation and can be accessed over the raw attribute.
Instance Attribute Summary collapse
- #raw ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(hash) ⇒ Item
constructor
A new instance of Item.
- #title ⇒ Object
Constructor Details
#initialize(hash) ⇒ Item
Returns a new instance of Item.
208 209 210 |
# File 'lib/amazonian.rb', line 208 def initialize(hash) @raw = Hashie::Mash.new(hash) end |
Instance Attribute Details
#raw ⇒ Object (readonly)
207 208 209 |
# File 'lib/amazonian.rb', line 207 def raw @raw end |
Instance Method Details
#title ⇒ Object
212 213 214 215 216 217 218 |
# File 'lib/amazonian.rb', line 212 def title if @raw.ItemAttributes && @raw.ItemAttributes.Title @raw.ItemAttributes.Title else nil end end |