Class: Rafflesia::DiamondDbMaterializeData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/sequences/diamond_db_materialize_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  all_cache_hits: :all_cache_hits,
  db_prefix: :db_prefix,
  file_count: :file_count,
  files: :files,
  manifest_id: :manifest_id,
  manifest_path: :manifest_path,
  metrics: :metrics,
  ref: :ref,
  target_dir: :target_dir,
  total_size_bytes: :total_size_bytes,
  verified: :verified
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ DiamondDbMaterializeData

Returns a new instance of DiamondDbMaterializeData.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 35

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @all_cache_hits = hash[:all_cache_hits]
  @db_prefix = hash[:db_prefix]
  @file_count = hash[:file_count]
  @files = (hash[:files] || []).map { |item| item ? Rafflesia::DiamondDbMaterializedFile.new(item) : nil }
  @manifest_id = hash[:manifest_id]
  @manifest_path = hash[:manifest_path]
  @metrics = hash[:metrics] ? Rafflesia::CacheMaterializationMetrics.new(hash[:metrics]) : nil
  @ref = hash[:ref]
  @target_dir = hash[:target_dir]
  @total_size_bytes = hash[:total_size_bytes]
  @verified = hash[:verified]
end

Instance Attribute Details

#all_cache_hitsObject

Returns the value of attribute all_cache_hits.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def all_cache_hits
  @all_cache_hits
end

#db_prefixObject

Returns the value of attribute db_prefix.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def db_prefix
  @db_prefix
end

#file_countObject

Returns the value of attribute file_count.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def file_count
  @file_count
end

#filesObject

Returns the value of attribute files.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def files
  @files
end

#manifest_idObject

Returns the value of attribute manifest_id.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def manifest_id
  @manifest_id
end

#manifest_pathObject

Returns the value of attribute manifest_path.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def manifest_path
  @manifest_path
end

#metricsObject

Returns the value of attribute metrics.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def metrics
  @metrics
end

#refObject

Returns the value of attribute ref.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def ref
  @ref
end

#target_dirObject

Returns the value of attribute target_dir.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def target_dir
  @target_dir
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def total_size_bytes
  @total_size_bytes
end

#verifiedObject

Returns the value of attribute verified.



22
23
24
# File 'lib/rafflesia/sequences/diamond_db_materialize_data.rb', line 22

def verified
  @verified
end