Class: Rafflesia::FoldIndexMaterializedSegment

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/fold_index_materialized_segment.rb

Constant Summary collapse

HASH_ATTRS =
{
  all_cache_hits: :all_cache_hits,
  db_prefix: :db_prefix,
  file_count: :file_count,
  files: :files,
  metrics: :metrics,
  role: :role,
  segment_id: :segment_id,
  total_size_bytes: :total_size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldIndexMaterializedSegment

Returns a new instance of FoldIndexMaterializedSegment.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 29

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::FoldIndexMaterializedFile.new(item) : nil }
  @metrics = hash[:metrics] ? Rafflesia::CacheMaterializationMetrics.new(hash[:metrics]) : nil
  @role = hash[:role]
  @segment_id = hash[:segment_id]
  @total_size_bytes = hash[:total_size_bytes]
end

Instance Attribute Details

#all_cache_hitsObject

Returns the value of attribute all_cache_hits.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def all_cache_hits
  @all_cache_hits
end

#db_prefixObject

Returns the value of attribute db_prefix.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def db_prefix
  @db_prefix
end

#file_countObject

Returns the value of attribute file_count.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def file_count
  @file_count
end

#filesObject

Returns the value of attribute files.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def files
  @files
end

#metricsObject

Returns the value of attribute metrics.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def metrics
  @metrics
end

#roleObject

Returns the value of attribute role.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def role
  @role
end

#segment_idObject

Returns the value of attribute segment_id.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def segment_id
  @segment_id
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



19
20
21
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19

def total_size_bytes
  @total_size_bytes
end