Sha256: d420c269916dc611d365247f9d23c7268f44ff5390d8991de0445253ebdaa1cd
Contents?: true
Size: 1 KB
Versions: 58
Compression:
Stored size: 1 KB
Contents
module Vedeu module Input # A collection of {Vedeu::Input::Key} instances. # class Keys < Vedeu::Repositories::Collection end # Keys # A single keypress or combination of keypresses bound to a # specific action. # class Key # @!attribute [r] input # @return [String|Symbol] Returns the key defined. attr_reader :input alias_method :key, :input # Returns a new instance of Vedeu::Input::Key. # # @param input [String|Symbol] # @param block [Proc] # @raise [Vedeu::Error::RequiresBlock] # @return [Vedeu::Input::Key] def initialize(input = nil, &block) fail Vedeu::Error::RequiresBlock unless block_given? @input = input @output = block end # Pressing the key will call the procedure. # # @return [|Symbol] def output @output.call end alias_method :action, :output alias_method :press, :output end # Key end # Input end # Vedeu
Version data entries
58 entries across 58 versions & 1 rubygems