Class: Takeoff::Messages
- Inherits:
-
Object
- Object
- Takeoff::Messages
- Defined in:
- lib/project/messages.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
-
#initialize ⇒ Messages
constructor
A new instance of Messages.
- #schedule(opts = {}) ⇒ Object
- #takeoff ⇒ Object
Constructor Details
#initialize ⇒ Messages
Returns a new instance of Messages.
5 6 7 8 9 |
# File 'lib/project/messages.rb', line 5 def initialize self. = [] @launch_key = 'motion_takeoff_launch_count' handle_launch end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
3 4 5 |
# File 'lib/project/messages.rb', line 3 def @messages end |
Instance Method Details
#schedule(opts = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/project/messages.rb', line 11 def schedule(opts={}) raise "You must specify a :launch" unless opts[:launch] raise "You must specify a :title" unless opts[:title] raise "You must specify a :message" unless opts[:message] self. << opts end |
#takeoff ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/project/messages.rb', line 19 def takeoff self..each do || if [:launch] == App::Persistence[@launch_key] if .keys.include? :action confirm_alert else regular_alert end end end end |