class MovieMasher::Chain

base for all filter chains

Public Class Methods

new(input = nil, job_input = nil) click to toggle source
# File lib/graph.rb, line 116
def initialize(input = nil, job_input = nil)
  @input = input
  @job_input = job_input
  @filters = []
  # puts "Chain calling #initialize_filters"
  initialize_filters
end

Public Instance Methods

<<(filter) click to toggle source
# File lib/graph.rb, line 126
def <<(filter)
  @filters << filter
end
chain_command(scope) click to toggle source
# File lib/graph.rb, line 107
def chain_command(scope)
  cmds = @filters.map do |f|
    f.send(f.is_a?(Filter) ? :filter_command : :chain_command, scope)
  end
  __join_commands(cmds)
end
chain_labels(label, i) click to toggle source
# File lib/graph.rb, line 113
def chain_labels(label, i)
  "[#{label}#{1 == i ? '' : 'ed'}#{i - 1}][#{label}#{i}]"
end
initialize_filters() click to toggle source
# File lib/graph.rb, line 123
def initialize_filters
  # override me
end