Class: Rafflesia::DatasetCompaction

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

Constant Summary collapse

HASH_ATTRS =
{
  compacted_artifact_count: :compacted_artifact_count,
  is_compacted: :is_compacted,
  method: :method,
  row_count: :row_count,
  shard_size: :shard_size,
  source_artifact_count: :source_artifact_count,
  tables: :tables
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ DatasetCompaction

Returns a new instance of DatasetCompaction.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @compacted_artifact_count = hash[:compacted_artifact_count]
  @is_compacted = hash[:is_compacted]
  @method = hash[:method]
  @row_count = hash[:row_count]
  @shard_size = hash[:shard_size]
  @source_artifact_count = hash[:source_artifact_count]
  @tables = (hash[:tables] || []).map { |item| item ? Rafflesia::DatasetTableCompaction.new(item) : nil }
end

Instance Attribute Details

#compacted_artifact_countObject

Returns the value of attribute compacted_artifact_count.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def compacted_artifact_count
  @compacted_artifact_count
end

#is_compactedObject

Returns the value of attribute is_compacted.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def is_compacted
  @is_compacted
end

#methodObject

Returns the value of attribute method.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def method
  @method
end

#row_countObject

Returns the value of attribute row_count.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def row_count
  @row_count
end

#shard_sizeObject

Returns the value of attribute shard_size.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def shard_size
  @shard_size
end

#source_artifact_countObject

Returns the value of attribute source_artifact_count.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def source_artifact_count
  @source_artifact_count
end

#tablesObject

Returns the value of attribute tables.



18
19
20
# File 'lib/rafflesia/datasets/dataset_compaction.rb', line 18

def tables
  @tables
end