Class: Pushover::Message
- Inherits:
-
Struct
- Object
- Struct
- Pushover::Message
- Defined in:
- lib/pushover/message.rb
Overview
Message is a struct to send a message to pushover.
Instance Attribute Summary collapse
-
#attachment ⇒ Object
Returns the value of attribute attachment.
-
#callback ⇒ String
Callback url.
-
#device ⇒ String
Device to transmit too.
-
#expire ⇒ Numeric
Expire time until message expires.
-
#message ⇒ String
Message to transmit.
-
#priority ⇒ Numeric
Numeric value for priority.
-
#retry ⇒ Numeric
How long to retry for, in seconds.
-
#sound ⇒ String
Sound to play.
-
#timestamp ⇒ Numeric
Timestamp to expire, in epoch.
-
#title ⇒ String
Title of the message.
-
#token ⇒ String
Application token.
-
#url ⇒ String
Supplementary url.
-
#url_title ⇒ String
Title of the supplementary url.
-
#user ⇒ String
User key.
Instance Method Summary collapse
-
#push ⇒ Object
push the configured message to pushover.
Instance Attribute Details
#attachment ⇒ Object
Returns the value of attribute attachment
29 30 31 |
# File 'lib/pushover/message.rb', line 29 def end |
#callback ⇒ String
Returns callback url.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#device ⇒ String
Returns device to transmit too.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#expire ⇒ Numeric
Returns expire time until message expires.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#message ⇒ String
Returns message to transmit.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#priority ⇒ Numeric
Returns numeric value for priority.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#retry ⇒ Numeric
Returns how long to retry for, in seconds.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#sound ⇒ String
Returns sound to play.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#timestamp ⇒ Numeric
Returns timestamp to expire, in epoch.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#title ⇒ String
Returns title of the message.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#token ⇒ String
Returns application token.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#url ⇒ String
Returns supplementary url.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#url_title ⇒ String
Returns title of the supplementary url.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
#user ⇒ String
Returns user key.
29 30 31 32 33 34 35 36 37 |
# File 'lib/pushover/message.rb', line 29 Message = Struct.new(:token, :user, :message, :attachment, :device, :title, :url, :url_title, :priority, :sound, :timestamp, :expire, :retry, :callback, keyword_init: true) do # push the configured message to pushover. # @return [Response] response for the receipt request def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end end |
Instance Method Details
#push ⇒ Object
push the configured message to pushover.
@return [Response] response for the receipt request
32 33 34 35 36 |
# File 'lib/pushover/message.rb', line 32 def push i[token user ].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.post(path: '1/messages.json', query: to_h) end |