class MovieMasher::FilterHash

simplest filter

Attributes

hash[R]

Public Class Methods

new(id, hash = nil) click to toggle source
Calls superclass method MovieMasher::Filter.new
# File lib/graphs/filters.rb, line 212
def initialize(id, hash = nil)
  @hash = hash || {}
  super id
end

Public Instance Methods

filter_command(scope = nil) click to toggle source
Calls superclass method MovieMasher::Filter#filter_command
# File lib/graphs/filters.rb, line 216
def filter_command(scope = nil)
  cmd = super
  unless cmd.empty? # I'm not disabled
    cmds = []
    @hash.each do |name, value|
      name = name.id2name if name.is_a?(Symbol)
      value = __coerce_if_numeric(value)
      name = ShellHelper.escape(name)
      value = ShellHelper.escape(value)
      cmds << "#{name}=#{value}"
    end
    cmd = ShellHelper.escape(cmd)
    cmd = "#{cmd}=#{cmds.join(':')}" unless cmds.empty?
  end
  cmd
end