Class: Bullet::Notification::Base
- Inherits:
-
Object
- Object
- Bullet::Notification::Base
show all
- Defined in:
- lib/bullet/notification/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(base_class, associations, path = nil) ⇒ Base
Returns a new instance of Base.
7
8
9
10
11
|
# File 'lib/bullet/notification/base.rb', line 7
def initialize( base_class, associations, path = nil )
@base_class = base_class
@associations = associations.is_a?( Array ) ? associations : [ associations ]
@path = path
end
|
Instance Attribute Details
#associations ⇒ Object
Returns the value of attribute associations.
5
6
7
|
# File 'lib/bullet/notification/base.rb', line 5
def associations
@associations
end
|
#base_class ⇒ Object
Returns the value of attribute base_class.
5
6
7
|
# File 'lib/bullet/notification/base.rb', line 5
def base_class
@base_class
end
|
#notifier ⇒ Object
Returns the value of attribute notifier.
4
5
6
|
# File 'lib/bullet/notification/base.rb', line 4
def notifier
@notifier
end
|
#path ⇒ Object
Returns the value of attribute path.
5
6
7
|
# File 'lib/bullet/notification/base.rb', line 5
def path
@path
end
|
Instance Method Details
#body ⇒ Object
16
17
|
# File 'lib/bullet/notification/base.rb', line 16
def body
end
|
#body_with_caller ⇒ Object
19
20
21
|
# File 'lib/bullet/notification/base.rb', line 19
def body_with_caller
body
end
|
#eql?(other) ⇒ Boolean
39
40
41
|
# File 'lib/bullet/notification/base.rb', line 39
def eql?( other )
klazz_associations_str == other.klazz_associations_str
end
|
#full_notice ⇒ Object
27
28
29
|
# File 'lib/bullet/notification/base.rb', line 27
def full_notice
@full_notice ||= title + "\n" + body_with_caller
end
|
#hash ⇒ Object
43
44
45
|
# File 'lib/bullet/notification/base.rb', line 43
def hash
klazz_associations_str.hash
end
|
#notify_inline ⇒ Object
31
32
33
|
# File 'lib/bullet/notification/base.rb', line 31
def notify_inline
self.notifier.inline_notify( self.full_notice )
end
|
#notify_out_of_channel ⇒ Object
35
36
37
|
# File 'lib/bullet/notification/base.rb', line 35
def notify_out_of_channel
self.notifier.out_of_channel_notify( self.full_notice )
end
|
#standard_notice ⇒ Object
23
24
25
|
# File 'lib/bullet/notification/base.rb', line 23
def standard_notice
@standard_notifice ||= title + "\n" + body
end
|
#title ⇒ Object
13
14
|
# File 'lib/bullet/notification/base.rb', line 13
def title
end
|