Class: Rafflesia::DatasetManifestInspectData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/datasets/dataset_manifest_inspect_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  dataset_name: :dataset_name,
  dataset_version: :dataset_version,
  failure_count: :failure_count,
  input_dir: :input_dir,
  manifest_path: :manifest_path,
  manifest_sha256: :manifest_sha_256,
  manifest_version: :manifest_version,
  output_dir: :output_dir,
  row_count: :row_count,
  schema_hashes: :schema_hashes,
  schema_version: :schema_version,
  source: :source,
  structure_count: :structure_count,
  table_artifact_count: :table_artifact_count,
  table_artifact_counts: :table_artifact_counts,
  table_row_counts: :table_row_counts,
  table_summaries: :table_summaries,
  tables: :tables
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ DatasetManifestInspectData

Returns a new instance of DatasetManifestInspectData.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 49

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @dataset_name = hash[:dataset_name]
  @dataset_version = hash[:dataset_version]
  @failure_count = hash[:failure_count]
  @input_dir = hash[:input_dir]
  @manifest_path = hash[:manifest_path]
  @manifest_sha_256 = hash[:manifest_sha256]
  @manifest_version = hash[:manifest_version]
  @output_dir = hash[:output_dir]
  @row_count = hash[:row_count]
  @schema_hashes = (hash[:schema_hashes] || [])
  @schema_version = hash[:schema_version]
  @source = hash[:source]
  @structure_count = hash[:structure_count]
  @table_artifact_count = hash[:table_artifact_count]
  @table_artifact_counts = hash[:table_artifact_counts] || {}
  @table_row_counts = hash[:table_row_counts] || {}
  @table_summaries = (hash[:table_summaries] || []).map { |item| item ? Rafflesia::DatasetBuildTableSummary.new(item) : nil }
  @tables = (hash[:tables] || [])
end

Instance Attribute Details

#dataset_nameObject

Returns the value of attribute dataset_name.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def dataset_name
  @dataset_name
end

#dataset_versionObject

Returns the value of attribute dataset_version.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def dataset_version
  @dataset_version
end

#failure_countObject

Returns the value of attribute failure_count.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def failure_count
  @failure_count
end

#input_dirObject

Returns the value of attribute input_dir.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def input_dir
  @input_dir
end

#manifest_pathObject

Returns the value of attribute manifest_path.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def manifest_path
  @manifest_path
end

#manifest_sha_256Object

Returns the value of attribute manifest_sha_256.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def manifest_sha_256
  @manifest_sha_256
end

#manifest_versionObject

Returns the value of attribute manifest_version.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def manifest_version
  @manifest_version
end

#output_dirObject

Returns the value of attribute output_dir.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def output_dir
  @output_dir
end

#row_countObject

Returns the value of attribute row_count.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def row_count
  @row_count
end

#schema_hashesObject

Returns the value of attribute schema_hashes.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def schema_hashes
  @schema_hashes
end

#schema_versionObject

Returns the value of attribute schema_version.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def schema_version
  @schema_version
end

#sourceObject

Returns the value of attribute source.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def source
  @source
end

#structure_countObject

Returns the value of attribute structure_count.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def structure_count
  @structure_count
end

#table_artifact_countObject

Returns the value of attribute table_artifact_count.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def table_artifact_count
  @table_artifact_count
end

#table_artifact_countsObject

Returns the value of attribute table_artifact_counts.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def table_artifact_counts
  @table_artifact_counts
end

#table_row_countsObject

Returns the value of attribute table_row_counts.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def table_row_counts
  @table_row_counts
end

#table_summariesObject

Returns the value of attribute table_summaries.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def table_summaries
  @table_summaries
end

#tablesObject

Returns the value of attribute tables.



29
30
31
# File 'lib/rafflesia/datasets/dataset_manifest_inspect_data.rb', line 29

def tables
  @tables
end