Class: Rafflesia::FoldIndexMaterializedShard
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::FoldIndexMaterializedShard
- Defined in:
- lib/rafflesia/proteins/fold_index_materialized_shard.rb
Constant Summary collapse
- HASH_ATTRS =
{ all_cache_hits: :all_cache_hits, db_prefix: :db_prefix, file_count: :file_count, files: :files, metrics: :metrics, shard_id: :shard_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.
-
#shard_id ⇒ Object
Returns the value of attribute shard_id.
-
#total_size_bytes ⇒ Object
Returns the value of attribute total_size_bytes.
Instance Method Summary collapse
-
#initialize(json) ⇒ FoldIndexMaterializedShard
constructor
A new instance of FoldIndexMaterializedShard.
Constructor Details
#initialize(json) ⇒ FoldIndexMaterializedShard
Returns a new instance of FoldIndexMaterializedShard.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 27 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 @shard_id = hash[:shard_id] @total_size_bytes = hash[:total_size_bytes] end |
Instance Attribute Details
#all_cache_hits ⇒ Object
Returns the value of attribute all_cache_hits.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def all_cache_hits @all_cache_hits end |
#db_prefix ⇒ Object
Returns the value of attribute db_prefix.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def db_prefix @db_prefix end |
#file_count ⇒ Object
Returns the value of attribute file_count.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def file_count @file_count end |
#files ⇒ Object
Returns the value of attribute files.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def files @files end |
#metrics ⇒ Object
Returns the value of attribute metrics.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def metrics @metrics end |
#shard_id ⇒ Object
Returns the value of attribute shard_id.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def shard_id @shard_id end |
#total_size_bytes ⇒ Object
Returns the value of attribute total_size_bytes.
18 19 20 |
# File 'lib/rafflesia/proteins/fold_index_materialized_shard.rb', line 18 def total_size_bytes @total_size_bytes end |