Class: Shutterstock::Licenses
- Inherits:
-
Array
- Object
- Array
- Shutterstock::Licenses
- Defined in:
- lib/client/licenses.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
Instance Method Summary collapse
-
#initialize(raw_data) ⇒ Licenses
constructor
A new instance of Licenses.
Constructor Details
#initialize(raw_data) ⇒ Licenses
Returns a new instance of Licenses.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/client/licenses.rb', line 4 def initialize(raw_data) @raw_data = raw_data if raw_data.kind_of? Hash super(@raw_data["data"].map{ |license| License.new(license) }) @total_count = raw_data["total_count"].to_i @page = raw_data["page"].to_i @per_page = raw_data["per_page"].to_i @message = raw_data["message"] @errors = raw_data["errors"] elsif raw_data.kind_of? Array super( @raw_data.map{ |license| License.new(license) } ) end self end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/client/licenses.rb', line 3 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/client/licenses.rb', line 3 def @message end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
3 4 5 |
# File 'lib/client/licenses.rb', line 3 def page @page end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
3 4 5 |
# File 'lib/client/licenses.rb', line 3 def per_page @per_page end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
3 4 5 |
# File 'lib/client/licenses.rb', line 3 def raw_data @raw_data end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
3 4 5 |
# File 'lib/client/licenses.rb', line 3 def total_count @total_count end |