Sha256: da61828a664a82f52eaeaa9a7d460b045edae3f25df4c9c9c398ab6f439188da
Contents?: true
Size: 908 Bytes
Versions: 1
Compression:
Stored size: 908 Bytes
Contents
module Vedeu class Process class << self def evaluate new.evaluate end end def initialize; end def evaluate raise Collapse if result == :stop Compositor.arrange(result) unless no_result? end private def result @result ||= command.execute(*args) if command end def no_result? result.nil? || result.empty? end def command @command ||= find_by_keypress || find_by_keyword end def find_by_keypress CommandRepository.by_keypress(input) if keypress? end def find_by_keyword CommandRepository.by_keyword(input) if keyword? end def keypress? input? && input.size == 1 end def keyword? input? && input.size > 1 end def input? !!(input) end def input @input ||= Queue.dequeue end def args [] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.0.18 | lib/vedeu/process/process.rb |