Class: Submission::FlexibleRequestGraph::UnplexedLink

Inherits:
Object
  • Object
show all
Includes:
ChainLink
Defined in:
app/models/submission/flexible_request_graph.rb

Instance Method Summary collapse

Methods included from ChainLink

#build!, build!, included, #multiplexed?, #target_assets

Constructor Details

#initialize(request_type, multiplier, assets, chain) ⇒ UnplexedLink

Returns a new instance of UnplexedLink

Raises:


201
202
203
204
205
# File 'app/models/submission/flexible_request_graph.rb', line 201

def initialize(request_type, multiplier, assets, chain)
  raise RequestChainError if request_type.for_multiplexing?

  super
end

Instance Method Details

#generate_target_assetsObject


207
208
209
210
211
212
213
214
# File 'app/models/submission/flexible_request_graph.rb', line 207

def generate_target_assets
  source_assets_qc_metrics.map do |doublet|
    Doublet.new(create_target_asset(doublet.asset), doublet.qc_metric)
  end.tap do |new_target_assets|
    @target_assets_qc_metrics ||= []
    @target_assets_qc_metrics.concat(new_target_assets)
  end
end

#source_assets_doublet_with_indexObject


216
217
218
219
220
# File 'app/models/submission/flexible_request_graph.rb', line 216

def source_assets_doublet_with_index
  source_assets_qc_metrics.each_with_index do |doublet, index|
    yield(doublet, index)
  end
end