Class: Noti::Notification
- Inherits:
-
Object
- Object
- Noti::Notification
- Defined in:
- lib/noti/notification.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
Returns the value of attribute image.
-
#sound ⇒ Object
Returns the value of attribute sound.
-
#text ⇒ Object
Returns the value of attribute text.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#image ⇒ Object
Returns the value of attribute image.
4 5 6 |
# File 'lib/noti/notification.rb', line 4 def image @image end |
#sound ⇒ Object
Returns the value of attribute sound.
4 5 6 |
# File 'lib/noti/notification.rb', line 4 def sound @sound end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/noti/notification.rb', line 4 def text @text end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/noti/notification.rb', line 4 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/noti/notification.rb', line 4 def url @url end |
Instance Method Details
#deliver_to(user) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/noti/notification.rb', line 6 def deliver_to(user) data = { :app => Noti.app, :user => user, :notification => { :title => self.title, :text => self.text, :url => self.url, :sound => self.sound, :image => self.image } } Noti::Request.request('add', data) && true end |