Class: Submission::FlexibleRequestGraph::UnplexedLink

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

Overview

rubocop:todo Style/Documentation

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:


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

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

  super
end

Instance Method Details

#generate_target_assetsObject


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

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


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

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