Class: Rafflesia::InfraRequestListData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::InfraRequestListData
- Defined in:
- lib/rafflesia/system/infra_request_list_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ data: :data, has_more: :has_more, list_metadata: :list_metadata }.freeze
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#has_more ⇒ Object
Returns the value of attribute has_more.
-
#list_metadata ⇒ Object
Returns the value of attribute list_metadata.
Instance Method Summary collapse
-
#initialize(json) ⇒ InfraRequestListData
constructor
A new instance of InfraRequestListData.
Constructor Details
#initialize(json) ⇒ InfraRequestListData
Returns a new instance of InfraRequestListData.
19 20 21 22 23 24 25 |
# File 'lib/rafflesia/system/infra_request_list_data.rb', line 19 def initialize(json) super() hash = self.class.normalize(json) @data = (hash[:data] || []).map { |item| item ? Rafflesia::InfraRequestRecord.new(item) : nil } @has_more = hash[:has_more] @list_metadata = hash[:list_metadata] ? Rafflesia::PaginationCursor.new(hash[:list_metadata]) : nil end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
14 15 16 |
# File 'lib/rafflesia/system/infra_request_list_data.rb', line 14 def data @data end |
#has_more ⇒ Object
Returns the value of attribute has_more.
14 15 16 |
# File 'lib/rafflesia/system/infra_request_list_data.rb', line 14 def has_more @has_more end |
#list_metadata ⇒ Object
Returns the value of attribute list_metadata.
14 15 16 |
# File 'lib/rafflesia/system/infra_request_list_data.rb', line 14 def @list_metadata end |