class Gamefic::Command
A concrete representation of an input as a verb and an array of arguments.
Attributes
@return [Array<Array<Entity>, Entity
, String>]
@return [String, nil]
@return [Symbol]
Public Class Methods
Source
# File lib/gamefic/command.rb, line 20 def initialize(verb, arguments, meta = false, input = nil) @verb = verb @arguments = arguments @meta = meta @input = input @cancelled = false end
@param verb [Symbol] @param arguments [Array<Array<Entity>, Entity
, String>] @param meta [Boolean] @param input [String, nil]
Public Instance Methods
Source
# File lib/gamefic/command.rb, line 28 def cancel @cancelled = true end
Also aliased as: stop
Source
# File lib/gamefic/command.rb, line 33 def cancelled? @cancelled end
Also aliased as: stopped?
Source
# File lib/gamefic/command.rb, line 46 def inspect "#<#{self.class} #{([verb] + arguments).map(&:inspect).join(', ')}>" end