class MovieMasher::GraphUtility

base class for most other graph related classes

Public Instance Methods

__coerce_if_numeric(value) click to toggle source
# File lib/graph.rb, line 16
def __coerce_if_numeric(value)
  Evaluate.coerce_if_numeric(value)
end
__is_and_not_empty(thing) click to toggle source
# File lib/graph.rb, line 19
def __is_and_not_empty(thing)
  thing && !thing.empty?
end
__join_commands(cmds) click to toggle source
# File lib/graph.rb, line 5
def __join_commands(cmds)
  joined_commands = []
  cmds = cmds.reject(&:empty?)
  c = cmds.length
  c.times do |i|
    cmd = cmds[i]
    cmd = "#{cmd}," unless (i.zero? && cmd.end_with?(':v]')) || i == c - 1
    joined_commands << cmd
  end
  joined_commands.join
end
__raise_if_empty(s, msg) click to toggle source
# File lib/graph.rb, line 22
def __raise_if_empty(s, msg)
  raise(Error::JobInput, msg) if s.empty?
end
__raise_unless(tf, msg) click to toggle source
# File lib/graph.rb, line 25
def __raise_unless(tf, msg)
  raise(Error::JobInput, msg) unless tf
end