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:



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

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

  super
end

Instance Method Details

#generate_target_assetsObject



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

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

#source_assets_doublet_with_indexObject



225
226
227
# File 'app/models/submission/flexible_request_graph.rb', line 225

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