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 108
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 92
def <<(filter)
  @filters << filter
end
chain_command(scope) click to toggle source
# File lib/graph.rb, line 95
def chain_command(scope)
  cmds = []
  @filters.each do |filter|
    cmd =
      if filter.is_a?(Filter)
        filter.filter_command(scope)
      else
        filter.chain_command(scope)
      end
    cmds << cmd unless cmd.to_s.empty?
  end
  cmds.join(',')
end
initialize_filters() click to toggle source
# File lib/graph.rb, line 115
def initialize_filters
  # override me
end