Class: Ruboty::Hubot::Robot
- Inherits:
-
Object
- Object
- Ruboty::Hubot::Robot
- Includes:
- Mem
- Defined in:
- lib/ruboty/hubot/robot.rb
Instance Method Summary collapse
-
#initialize ⇒ Robot
constructor
A new instance of Robot.
- #load_script(script) ⇒ Object
- #receive(text) ⇒ Object
Constructor Details
#initialize ⇒ Robot
Returns a new instance of Robot.
8 9 10 |
# File 'lib/ruboty/hubot/robot.rb', line 8 def initialize @scripts = [] end |
Instance Method Details
#load_script(script) ⇒ Object
12 13 14 |
# File 'lib/ruboty/hubot/robot.rb', line 12 def load_script(script) @scripts << script end |
#receive(text) ⇒ Object
16 17 18 19 20 |
# File 'lib/ruboty/hubot/robot.rb', line 16 def receive(text) if res_text = robot_context.call("ruboty.receive", text) yield res_text if block_given? end end |