Class: Gamefic::Command
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
-
#arguments ⇒ Array<String>
readonly
An Array of arguments to be mapped to an Action’s Queries.
-
#verb ⇒ Symbol
readonly
A Symbol representing the command’s verb or verbal phrase.
Instance Method Summary collapse
-
#initialize(verb, arguments) ⇒ Command
constructor
A new instance of Command.
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
#arguments ⇒ Array<String> (readonly)
An Array of arguments to be mapped to an Action’s Queries.
14 15 16 |
# File 'lib/gamefic/command.rb', line 14 def arguments @arguments end |
#verb ⇒ Symbol (readonly)
A Symbol representing the command’s verb or verbal phrase.
9 10 11 |
# File 'lib/gamefic/command.rb', line 9 def verb @verb end |