Class: Rafflesia::FoldIndexMaterializedSegment
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::FoldIndexMaterializedSegment
- 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
-
#all_cache_hits ⇒ Object
Returns the value of attribute all_cache_hits.
-
#db_prefix ⇒ Object
Returns the value of attribute db_prefix.
-
#file_count ⇒ Object
Returns the value of attribute file_count.
-
#files ⇒ Object
Returns the value of attribute files.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#role ⇒ Object
Returns the value of attribute role.
-
#segment_id ⇒ Object
Returns the value of attribute segment_id.
-
#total_size_bytes ⇒ Object
Returns the value of attribute total_size_bytes.
Instance Method Summary collapse
-
#initialize(json) ⇒ FoldIndexMaterializedSegment
constructor
A new instance of FoldIndexMaterializedSegment.
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_hits ⇒ Object
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_prefix ⇒ Object
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_count ⇒ Object
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 |
#files ⇒ Object
Returns the value of attribute files.
19 20 21 |
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19 def files @files end |
#metrics ⇒ Object
Returns the value of attribute metrics.
19 20 21 |
# File 'lib/rafflesia/proteins/fold_index_materialized_segment.rb', line 19 def metrics @metrics end |
#role ⇒ Object
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_id ⇒ Object
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_bytes ⇒ Object
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 |