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