Class: Pushover::Message

Inherits:
Struct
  • Object
show all
Defined in:
lib/pushover/message.rb

Overview

Message is a struct to send a message to pushover.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attachmentObject

Returns the value of attribute attachment

Returns:

  • (Object)

    the current value of attachment



29
30
31
# File 'lib/pushover/message.rb', line 29

def attachment
  @attachment
end

#callbackString

Returns callback url.

Returns:

  • (String)

    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 message].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

#deviceString

Returns device to transmit too.

Returns:

  • (String)

    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 message].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

#expireNumeric

Returns expire time until message expires.

Returns:

  • (Numeric)

    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 message].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

#messageString

Returns message to transmit.

Returns:

  • (String)

    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 message].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

#priorityNumeric

Returns numeric value for priority.

Returns:

  • (Numeric)

    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 message].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

#retryNumeric

Returns how long to retry for, in seconds.

Returns:

  • (Numeric)

    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 message].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

#soundString

Returns sound to play.

Returns:

  • (String)

    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 message].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

#timestampNumeric

Returns timestamp to expire, in epoch.

Returns:

  • (Numeric)

    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 message].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

#titleString

Returns title of the message.

Returns:

  • (String)

    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 message].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

#tokenString

Returns application token.

Returns:

  • (String)

    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 message].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

#urlString

Returns supplementary url.

Returns:

  • (String)

    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 message].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_titleString

Returns title of the supplementary url.

Returns:

  • (String)

    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 message].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

#userString

Returns user key.

Returns:

  • (String)

    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 message].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

#pushObject

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 message].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