Class: Rafflesia::FoldIndexRoutingManifest

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

Constant Summary collapse

HASH_ATTRS =
{
  artifacts: :artifacts,
  build_command: :build_command,
  db_base: :db_base,
  representative_count: :representative_count,
  representative_selection: :representative_selection,
  representatives_per_shard: :representatives_per_shard,
  segment_id: :segment_id,
  selection_metrics: :selection_metrics,
  strategy: :strategy,
  target_to_shard: :target_to_shard
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldIndexRoutingManifest

Returns a new instance of FoldIndexRoutingManifest.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @artifacts = (hash[:artifacts] || []).map { |item| item ? Rafflesia::FoldIndexArtifact.new(item) : nil }
  @build_command = (hash[:build_command] || [])
  @db_base = hash[:db_base]
  @representative_count = hash[:representative_count]
  @representative_selection = hash[:representative_selection]
  @representatives_per_shard = hash[:representatives_per_shard]
  @segment_id = hash[:segment_id]
  @selection_metrics = (hash[:selection_metrics] || []).map { |item| item ? Rafflesia::FoldIndexRoutingShardSelectionMetric.new(item) : nil }
  @strategy = hash[:strategy]
  @target_to_shard = hash[:target_to_shard] || {}
end

Instance Attribute Details

#artifactsObject

Returns the value of attribute artifacts.



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

def artifacts
  @artifacts
end

#build_commandObject

Returns the value of attribute build_command.



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

def build_command
  @build_command
end

#db_baseObject

Returns the value of attribute db_base.



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

def db_base
  @db_base
end

#representative_countObject

Returns the value of attribute representative_count.



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

def representative_count
  @representative_count
end

#representative_selectionObject

Returns the value of attribute representative_selection.



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

def representative_selection
  @representative_selection
end

#representatives_per_shardObject

Returns the value of attribute representatives_per_shard.



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

def representatives_per_shard
  @representatives_per_shard
end

#segment_idObject

Returns the value of attribute segment_id.



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

def segment_id
  @segment_id
end

#selection_metricsObject

Returns the value of attribute selection_metrics.



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

def selection_metrics
  @selection_metrics
end

#strategyObject

Returns the value of attribute strategy.



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

def strategy
  @strategy
end

#target_to_shardObject

Returns the value of attribute target_to_shard.



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

def target_to_shard
  @target_to_shard
end