Class/Module Index [+]

Quicksearch

Ruote::Exp::CommandMixin

Commands are understood by the cursor, loop and iterator expressions.

Protected Instance Methods

get_command(workitem) click to toggle source

TODO : :ignore_workitem / :disallow => 'workitem' thing ?

# File lib/ruote/exp/command.rb, line 40
def get_command (workitem)

  command, step = workitem['fields'].delete(F_COMMAND)
  command, step = lookup_attribute_command(workitem) unless command
  command = 'break' if command == 'over' || command == 'stop'

  return nil if command == nil

  if command == 'back'
    command = 'skip'
    step = step ? -step : -1
  elsif command == 'skip'
    step ||= 1
  end

  [ command, step ]
end
lookup_att_com(dir, workitem) click to toggle source
# File lib/ruote/exp/command.rb, line 68
def lookup_att_com (dir, workitem)

  ATT_COMMANDS.each do |com|

    c =
      attribute("#{com}_#{dir}", workitem) ||
      attribute("#{com}-#{dir}", workitem)

    next unless c

    c = Condition.true?(c)

    return [ com, nil ]            if (dir == 'if' && c) || (dir == 'unless' && ( ! c))
  end

  nil
end
lookup_attribute_command(workitem) click to toggle source
# File lib/ruote/exp/command.rb, line 63
def lookup_attribute_command (workitem)

  lookup_att_com('if', workitem) || lookup_att_com('unless', workitem)
end
set_command(workitem, command, step=nil) click to toggle source
# File lib/ruote/exp/command.rb, line 58
def set_command (workitem, command, step=nil)

  workitem['fields'][F_COMMAND] = [ command, step ]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.