module Gamefic::Scriptable::Syntaxes
Public Instance Methods
Source
# File lib/gamefic/scriptable/syntaxes.rb, line 20 def interpret command, translation syntaxes.push(Syntax.new(command, translation)).last end
Create an alternate Syntax
for a response. The command and its translation can be parameterized.
@example Create a synonym for an ‘inventory` response.
interpret "catalogue", "inventory" # The command "catalogue" will be translated to "inventory"
@example Create a parameterized synonym for a ‘look` response.
interpret "scrutinize :entity", "look :entity" # The command "scrutinize chair" will be translated to "look chair"
@param command [String] The format of the original command @param translation [String] The format of the translated command @return [Syntax] the Syntax
object
Source
# File lib/gamefic/scriptable/syntaxes.rb, line 24 def syntaxes @syntaxes ||= [] end