Class: Rafflesia::DatabaseListData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::DatabaseListData
- Defined in:
- lib/rafflesia/databases/database_list_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ data: :data, has_more: :has_more, object: :object, url: :url }.freeze
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#has_more ⇒ Object
Returns the value of attribute has_more.
-
#object ⇒ Object
Returns the value of attribute object.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(json) ⇒ DatabaseListData
constructor
A new instance of DatabaseListData.
Constructor Details
#initialize(json) ⇒ DatabaseListData
Returns a new instance of DatabaseListData.
21 22 23 24 25 26 27 28 |
# File 'lib/rafflesia/databases/database_list_data.rb', line 21 def initialize(json) super() hash = self.class.normalize(json) @data = (hash[:data] || []).map { |item| item ? Rafflesia::DatabaseSummary.new(item) : nil } @has_more = hash[:has_more] @object = hash[:object] @url = hash[:url] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
15 16 17 |
# File 'lib/rafflesia/databases/database_list_data.rb', line 15 def data @data end |
#has_more ⇒ Object
Returns the value of attribute has_more.
15 16 17 |
# File 'lib/rafflesia/databases/database_list_data.rb', line 15 def has_more @has_more end |
#object ⇒ Object
Returns the value of attribute object.
15 16 17 |
# File 'lib/rafflesia/databases/database_list_data.rb', line 15 def object @object end |
#url ⇒ Object
Returns the value of attribute url.
15 16 17 |
# File 'lib/rafflesia/databases/database_list_data.rb', line 15 def url @url end |