class MovieMasher::ChainModule

a theme or transition filter chain

Attributes

input[W]

Public Class Methods

new(mod_input, mash_input, applied_input) click to toggle source
Calls superclass method MovieMasher::Chain.new
# File lib/graphs/chains.rb, line 17
def initialize(mod_input, mash_input, applied_input)
  # applied_input is same as mod_input for themes
  raise(Error::Parameter, 'no mod_input') unless mod_input
  # raise(Error::Parameter, 'no mash_input') unless mash_input
  # raise(Error::Parameter, 'no applied_input') unless applied_input
  @applied_input = applied_input
  super(mod_input, mash_input)
end

Public Instance Methods

chain_command(scope) click to toggle source
Calls superclass method MovieMasher::Chain#chain_command
# File lib/graphs/chains.rb, line 34
def chain_command(scope)
  scope = input_scope(scope)
  super
end
initialize_filters() click to toggle source
# File lib/graphs/chains.rb, line 25
def initialize_filters
  if __is_and_not_empty(@input[:filters]) && @input[:filters].is_a?(Array)
    @filters += @input[:filters].map do |filter_config|
      FilterEvaluated.new(filter_config, @job_input, @applied_input)
    end
  else
    raise(Error::JobInput, "ChainModule with no filters #{@input}")
  end
end
input_scope(scope) click to toggle source
# File lib/graphs/chains.rb, line 38
def input_scope(scope)
  scope = scope.dup # shallow copy, so any objects are just pointers
  properties = @input[:properties]
  if __is_and_not_empty(properties) && properties.is_a?(Hash)
    properties.each do |property, ob|
      scope[property] = @input[property] || ob[:value]
      # puts "#{property} = #{scope[property]}"
    end
  end
  scope
end