Class: EnoughFields::Notification
- Inherits:
-
Object
- Object
- EnoughFields::Notification
- Defined in:
- lib/enough_fields/notification.rb
Instance Attribute Summary collapse
-
#notifier ⇒ Object
Returns the value of attribute notifier.
Instance Method Summary collapse
- #full_notice ⇒ Object
-
#initialize(call_stack, klass, fields) ⇒ Notification
constructor
A new instance of Notification.
- #notify_inline ⇒ Object
- #notify_out_of_channel ⇒ Object
Constructor Details
#initialize(call_stack, klass, fields) ⇒ Notification
Returns a new instance of Notification.
5 6 7 8 9 |
# File 'lib/enough_fields/notification.rb', line 5 def initialize(call_stack, klass, fields) @call_stack = call_stack @klass = klass @fields = fields end |
Instance Attribute Details
#notifier ⇒ Object
Returns the value of attribute notifier.
3 4 5 |
# File 'lib/enough_fields/notification.rb', line 3 def notifier @notifier end |
Instance Method Details
#full_notice ⇒ Object
11 12 13 |
# File 'lib/enough_fields/notification.rb', line 11 def full_notice "add .only(:#{@fields.join(", :")}) for\n#{@call_stack.join("\n")}" end |
#notify_inline ⇒ Object
15 16 17 |
# File 'lib/enough_fields/notification.rb', line 15 def notify_inline self.notifier.inline_notify( self.full_notice ) end |
#notify_out_of_channel ⇒ Object
19 20 21 |
# File 'lib/enough_fields/notification.rb', line 19 def notify_out_of_channel self.notifier.out_of_channel_notify( self.full_notice ) end |