Class: Massive::Notifiers::Base
- Inherits:
-
Object
- Object
- Massive::Notifiers::Base
- Includes:
- Locking
- Defined in:
- lib/massive/notifiers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#last ⇒ Object
Returns the value of attribute last.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(id, options = {}) ⇒ Base
constructor
A new instance of Base.
- #notify(message, data = nil, &block) ⇒ Object
Methods included from Locking
Constructor Details
#initialize(id, options = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/massive/notifiers/base.rb', line 8 def initialize(id, ={}) self.id = id self.last = {} self. = || {} end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/massive/notifiers/base.rb', line 6 def id @id end |
#last ⇒ Object
Returns the value of attribute last.
6 7 8 |
# File 'lib/massive/notifiers/base.rb', line 6 def last @last end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/massive/notifiers/base.rb', line 6 def @options end |
Instance Method Details
#notify(message, data = nil, &block) ⇒ Object
15 16 17 |
# File 'lib/massive/notifiers/base.rb', line 15 def notify(, data=nil, &block) send_notification(, data, &block) unless locked?(, expiration) end |