Class: Ruboty::Handlers::Base
- Inherits:
-
Object
- Object
- Ruboty::Handlers::Base
- Extended by:
- Mem
- Includes:
- Env::Validatable
- Defined in:
- lib/ruboty/handlers/base.rb
Instance Attribute Summary collapse
-
#robot ⇒ Object
readonly
Returns the value of attribute robot.
Class Method Summary collapse
Instance Method Summary collapse
- #call(message, options = {}) ⇒ Object
-
#initialize(robot) ⇒ Base
constructor
A new instance of Base.
Methods included from Env::Validatable
Constructor Details
#initialize(robot) ⇒ Base
Returns a new instance of Base.
25 26 27 28 |
# File 'lib/ruboty/handlers/base.rb', line 25 def initialize(robot) @robot = robot validate! end |
Instance Attribute Details
#robot ⇒ Object (readonly)
Returns the value of attribute robot.
23 24 25 |
# File 'lib/ruboty/handlers/base.rb', line 23 def robot @robot end |
Class Method Details
.actions ⇒ Object
15 16 17 |
# File 'lib/ruboty/handlers/base.rb', line 15 def actions [] end |
Instance Method Details
#call(message, options = {}) ⇒ Object
30 31 32 33 34 |
# File 'lib/ruboty/handlers/base.rb', line 30 def call(, = {}) self.class.actions.inject(false) do |matched, action| matched | action.call(self, , ) end end |