Class: Ellen::Robot
Constant Summary collapse
- DEFAULT_ROBOT_NAME =
"ellen"
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Robot
constructor
A new instance of Robot.
- #name ⇒ Object
- #receive(attributes) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Robot
Returns a new instance of Robot.
11 12 13 |
# File 'lib/ellen/robot.rb', line 11 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/ellen/robot.rb', line 9 def @options end |
Instance Method Details
#name ⇒ Object
30 31 32 |
# File 'lib/ellen/robot.rb', line 30 def name ENV["ROBOT_NAME"] || DEFAULT_ROBOT_NAME end |
#receive(attributes) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/ellen/robot.rb', line 23 def receive(attributes) = Message.new(attributes) handlers.each do |handler| handler.call() end end |
#run ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ellen/robot.rb', line 15 def run dotenv bundle setup validate adapt end |