Class: Rafflesia::DatasetManifest
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::DatasetManifest
- Defined in:
- lib/rafflesia/datasets/dataset_manifest.rb
Constant Summary collapse
- HASH_ATTRS =
{ compaction: :compaction, dataset_name: :dataset_name, dataset_version: :dataset_version, failures: :failures, input_dir: :input_dir, manifest_version: :manifest_version, output_dir: :output_dir, row_count: :row_count, source: :source, structures: :structures, table_artifacts: :table_artifacts, tables: :tables }.freeze
Instance Attribute Summary collapse
-
#compaction ⇒ Object
Returns the value of attribute compaction.
-
#dataset_name ⇒ Object
Returns the value of attribute dataset_name.
-
#dataset_version ⇒ Object
Returns the value of attribute dataset_version.
-
#failures ⇒ Object
Returns the value of attribute failures.
-
#input_dir ⇒ Object
Returns the value of attribute input_dir.
-
#manifest_version ⇒ Object
Returns the value of attribute manifest_version.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
-
#source ⇒ Object
Returns the value of attribute source.
-
#structures ⇒ Object
Returns the value of attribute structures.
-
#table_artifacts ⇒ Object
Returns the value of attribute table_artifacts.
-
#tables ⇒ Object
Returns the value of attribute tables.
Instance Method Summary collapse
-
#initialize(json) ⇒ DatasetManifest
constructor
A new instance of DatasetManifest.
Constructor Details
#initialize(json) ⇒ DatasetManifest
Returns a new instance of DatasetManifest.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 37 def initialize(json) super() hash = self.class.normalize(json) @compaction = hash[:compaction] ? Rafflesia::DatasetCompaction.new(hash[:compaction]) : nil @dataset_name = hash[:dataset_name] @dataset_version = hash[:dataset_version] @failures = (hash[:failures] || []).map { |item| item ? Rafflesia::DatasetFailure.new(item) : nil } @input_dir = hash[:input_dir] @manifest_version = hash[:manifest_version] @output_dir = hash[:output_dir] @row_count = hash[:row_count] @source = hash[:source] @structures = (hash[:structures] || []).map { |item| item ? Rafflesia::DatasetManifestStructure.new(item) : nil } @table_artifacts = (hash[:table_artifacts] || []).map { |item| item ? Rafflesia::DatasetTableArtifact.new(item) : nil } @tables = (hash[:tables] || []) end |
Instance Attribute Details
#compaction ⇒ Object
Returns the value of attribute compaction.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def compaction @compaction end |
#dataset_name ⇒ Object
Returns the value of attribute dataset_name.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def dataset_name @dataset_name end |
#dataset_version ⇒ Object
Returns the value of attribute dataset_version.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def dataset_version @dataset_version end |
#failures ⇒ Object
Returns the value of attribute failures.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def failures @failures end |
#input_dir ⇒ Object
Returns the value of attribute input_dir.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def input_dir @input_dir end |
#manifest_version ⇒ Object
Returns the value of attribute manifest_version.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def manifest_version @manifest_version end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def output_dir @output_dir end |
#row_count ⇒ Object
Returns the value of attribute row_count.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def row_count @row_count end |
#source ⇒ Object
Returns the value of attribute source.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def source @source end |
#structures ⇒ Object
Returns the value of attribute structures.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def structures @structures end |
#table_artifacts ⇒ Object
Returns the value of attribute table_artifacts.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def table_artifacts @table_artifacts end |
#tables ⇒ Object
Returns the value of attribute tables.
23 24 25 |
# File 'lib/rafflesia/datasets/dataset_manifest.rb', line 23 def tables @tables end |