Class: Shutterstock::Collections
- Inherits:
-
Array
- Object
- Array
- Shutterstock::Collections
- Defined in:
- lib/client/collections.rb
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Instance Method Summary collapse
-
#initialize(raw_data) ⇒ Collections
constructor
A new instance of Collections.
Constructor Details
#initialize(raw_data) ⇒ Collections
Returns a new instance of Collections.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/client/collections.rb', line 4 def initialize(raw_data) @raw_data = raw_data if raw_data.kind_of? Hash super(@raw_data["data"].map{ |collection| Collection.new(collection) }) elsif raw_data.kind_of? Array super( @raw_data.map{ |collection| Collection.new(collection) } ) end self end |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
3 4 5 |
# File 'lib/client/collections.rb', line 3 def raw_data @raw_data end |