Class: Notifiable::NotifierBase
- Inherits:
-
Object
- Object
- Notifiable::NotifierBase
- Defined in:
- lib/notifiable/notifier_base.rb
Class Attribute Summary collapse
-
.notifier_attributes ⇒ Object
readonly
Returns the value of attribute notifier_attributes.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(notification) ⇒ NotifierBase
constructor
A new instance of NotifierBase.
- #send_notification(device_token) ⇒ Object
Constructor Details
#initialize(notification) ⇒ NotifierBase
Returns a new instance of NotifierBase.
18 19 20 21 |
# File 'lib/notifiable/notifier_base.rb', line 18 def initialize(notification) @notification = notification @mutex = Mutex.new end |
Class Attribute Details
.notifier_attributes ⇒ Object (readonly)
Returns the value of attribute notifier_attributes.
15 16 17 |
# File 'lib/notifiable/notifier_base.rb', line 15 def notifier_attributes @notifier_attributes end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
6 7 8 |
# File 'lib/notifiable/notifier_base.rb', line 6 def env @env end |
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
6 7 8 |
# File 'lib/notifiable/notifier_base.rb', line 6 def notification @notification end |
Class Method Details
.notifier_attribute(*vars) ⇒ Object
8 9 10 11 12 |
# File 'lib/notifiable/notifier_base.rb', line 8 def self.notifier_attribute(*vars) @notifier_attributes ||= [] @notifier_attributes.concat vars attr_writer(*vars) end |
Instance Method Details
#close ⇒ Object
27 28 29 30 31 |
# File 'lib/notifiable/notifier_base.rb', line 27 def close flush save_receipts if Notifiable.save_receipts @notification.save end |
#send_notification(device_token) ⇒ Object
23 24 25 |
# File 'lib/notifiable/notifier_base.rb', line 23 def send_notification(device_token) enqueue(device_token, notification) end |