Class: Rafflesia::FoldIndexSegmentManifest

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

Constant Summary collapse

HASH_ATTRS =
{
  artifact_roles: :artifact_roles,
  file_count: :file_count,
  parameters: :parameters,
  role: :role,
  scope: :scope,
  segment_id: :segment_id,
  segment_type: :segment_type,
  shard_count: :shard_count,
  shards: :shards,
  total_size_bytes: :total_size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldIndexSegmentManifest

Returns a new instance of FoldIndexSegmentManifest.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 33

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @artifact_roles = (hash[:artifact_roles] || [])
  @file_count = hash[:file_count]
  @parameters = hash[:parameters] || {}
  @role = hash[:role]
  @scope = hash[:scope]
  @segment_id = hash[:segment_id]
  @segment_type = hash[:segment_type]
  @shard_count = hash[:shard_count]
  @shards = (hash[:shards] || []).map { |item| item ? Rafflesia::FoldIndexSegmentShard.new(item) : nil }
  @total_size_bytes = hash[:total_size_bytes]
end

Instance Attribute Details

#artifact_rolesObject

Returns the value of attribute artifact_roles.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def artifact_roles
  @artifact_roles
end

#file_countObject

Returns the value of attribute file_count.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def file_count
  @file_count
end

#parametersObject

Returns the value of attribute parameters.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def parameters
  @parameters
end

#roleObject

Returns the value of attribute role.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def role
  @role
end

#scopeObject

Returns the value of attribute scope.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def scope
  @scope
end

#segment_idObject

Returns the value of attribute segment_id.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def segment_id
  @segment_id
end

#segment_typeObject

Returns the value of attribute segment_type.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def segment_type
  @segment_type
end

#shard_countObject

Returns the value of attribute shard_count.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def shard_count
  @shard_count
end

#shardsObject

Returns the value of attribute shards.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def shards
  @shards
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



21
22
23
# File 'lib/rafflesia/proteins/fold_index_segment_manifest.rb', line 21

def total_size_bytes
  @total_size_bytes
end