Class: Gamefic::Command

Inherits:
Object show all
Defined in:
lib/gamefic/command.rb

Overview

A Command is a collection of tokens parsed from a Syntax. Playbooks use Commands to find and execute corresponding Actions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb, arguments) ⇒ Command

Returns a new instance of Command.



16
17
18
19
# File 'lib/gamefic/command.rb', line 16

def initialize verb, arguments
  @verb = verb
  @arguments = arguments
end

Instance Attribute Details

#argumentsArray<String> (readonly)

An Array of arguments to be mapped to an Action’s Queries.

Returns:



14
15
16
# File 'lib/gamefic/command.rb', line 14

def arguments
  @arguments
end

#verbSymbol (readonly)

A Symbol representing the command’s verb or verbal phrase.

Returns:



9
10
11
# File 'lib/gamefic/command.rb', line 9

def verb
  @verb
end