Class: Push4::Notification
- Inherits:
-
Object
- Object
- Push4::Notification
- Defined in:
- lib/push4.rb
Instance Attribute Summary collapse
-
#action_loc_key ⇒ Object
Returns the value of attribute action_loc_key.
-
#icon_url ⇒ Object
Returns the value of attribute icon_url.
-
#long_message ⇒ Object
Returns the value of attribute long_message.
-
#long_message_preview ⇒ Object
Returns the value of attribute long_message_preview.
-
#message ⇒ Object
Returns the value of attribute message.
-
#message_level ⇒ Object
Returns the value of attribute message_level.
-
#silent ⇒ Object
Returns the value of attribute silent.
-
#sound ⇒ Object
Returns the value of attribute sound.
-
#subtitle ⇒ Object
Returns the value of attribute subtitle.
-
#title ⇒ Object
Returns the value of attribute title.
-
#user_credentials ⇒ Object
Returns the value of attribute user_credentials.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Notification
constructor
A new instance of Notification.
- #send ⇒ Object
Constructor Details
#initialize ⇒ Notification
Returns a new instance of Notification.
33 34 35 36 |
# File 'lib/push4.rb', line 33 def initialize @data = {} self.user_credentials = Push4.user_credentials end |
Instance Attribute Details
#action_loc_key ⇒ Object
Returns the value of attribute action_loc_key.
19 20 21 |
# File 'lib/push4.rb', line 19 def action_loc_key @action_loc_key end |
#icon_url ⇒ Object
Returns the value of attribute icon_url.
20 21 22 |
# File 'lib/push4.rb', line 20 def icon_url @icon_url end |
#long_message ⇒ Object
Returns the value of attribute long_message.
13 14 15 |
# File 'lib/push4.rb', line 13 def @long_message end |
#long_message_preview ⇒ Object
Returns the value of attribute long_message_preview.
14 15 16 |
# File 'lib/push4.rb', line 14 def @long_message_preview end |
#message ⇒ Object
Returns the value of attribute message.
12 13 14 |
# File 'lib/push4.rb', line 12 def @message end |
#message_level ⇒ Object
Returns the value of attribute message_level.
17 18 19 |
# File 'lib/push4.rb', line 17 def @message_level end |
#silent ⇒ Object
Returns the value of attribute silent.
18 19 20 |
# File 'lib/push4.rb', line 18 def silent @silent end |
#sound ⇒ Object
Returns the value of attribute sound.
21 22 23 |
# File 'lib/push4.rb', line 21 def sound @sound end |
#subtitle ⇒ Object
Returns the value of attribute subtitle.
16 17 18 |
# File 'lib/push4.rb', line 16 def subtitle @subtitle end |
#title ⇒ Object
Returns the value of attribute title.
15 16 17 |
# File 'lib/push4.rb', line 15 def title @title end |
#user_credentials ⇒ Object
Returns the value of attribute user_credentials.
11 12 13 |
# File 'lib/push4.rb', line 11 def user_credentials @user_credentials end |
Class Method Details
.send ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/push4.rb', line 72 def self.send if block_given? notif = self.new yield notif notif.send end end |
Instance Method Details
#send ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/push4.rb', line 60 def send uri = URI(URL) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true req = Net::HTTP::Post.new(uri.to_s) req.set_form_data(@data) http.request(req) end |