class Samovar::Table
def << row
def << row @rows << row if row.respond_to?(:parse) @parser << row end end
def initialize
def initialize @rows = [] @parser = [] end
def parse(input, command)
def parse(input, command) @parser.each do |row| current = command.send(row.key) if result = row.parse(input, current) command.send("#{row.key}=", result) end end end
def usage
def usage @rows.collect(&:to_s).join(' ') end