Class: HubotGf::Command
- Inherits:
-
Object
- Object
- HubotGf::Command
- Defined in:
- lib/hubotgf/command.rb
Instance Attribute Summary collapse
-
#_method ⇒ Object
Returns the value of attribute _method.
-
#regex ⇒ Object
Returns the value of attribute regex.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #arguments ⇒ Object
-
#initialize(hash) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(hash) ⇒ Command
Returns a new instance of Command.
6 7 8 9 |
# File 'lib/hubotgf/command.rb', line 6 def initialize(hash) @regex = hash.keys.first @_method = hash.values.first end |
Instance Attribute Details
#_method ⇒ Object
Returns the value of attribute _method.
4 5 6 |
# File 'lib/hubotgf/command.rb', line 4 def _method @_method end |
#regex ⇒ Object
Returns the value of attribute regex.
4 5 6 |
# File 'lib/hubotgf/command.rb', line 4 def regex @regex end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/hubotgf/command.rb', line 4 def text @text end |
Instance Method Details
#arguments ⇒ Object
11 12 13 |
# File 'lib/hubotgf/command.rb', line 11 def arguments regex.match(text).captures end |