Class: ToyRobot::Command::Parser::Base
- Inherits:
-
Object
- Object
- ToyRobot::Command::Parser::Base
- Defined in:
- lib/toy_robot/command/parser/base.rb
Instance Method Summary collapse
- #build_with_match(string) ⇒ Object
-
#initialize(args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(args) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 |
# File 'lib/toy_robot/command/parser/base.rb', line 7 def initialize(args) @regex = args[:regex] @msg = args[:msg] @args_extractor = args[:args_extractor] end |
Instance Method Details
#build_with_match(string) ⇒ Object
13 14 15 |
# File 'lib/toy_robot/command/parser/base.rb', line 13 def build_with_match(string) build_command(string) if match?(string) end |