Class: EnoughFields::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/enough_fields/notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#notifierObject

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_noticeObject



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_inlineObject



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_channelObject



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