Class: Pushover::Receipt
- Inherits:
-
Struct
- Object
- Struct
- Pushover::Receipt
- Defined in:
- lib/pushover/receipt.rb
Overview
Receipt is a struct to interface with the receipt endpoint.
Instance Attribute Summary collapse
-
#receipt ⇒ String
Id of the receipt to request.
-
#token ⇒ String
Application token to check for a receipt.
Instance Method Summary collapse
-
#get ⇒ Response
Call pushover and return a response.
Instance Attribute Details
#receipt ⇒ String
Returns id of the receipt to request.
7 8 9 10 11 12 13 14 15 |
# File 'lib/pushover/receipt.rb', line 7 Receipt = Struct.new(:receipt, :token, keyword_init: true) do # Call pushover and return a response. # @return [Response] response for the receipt request def get %i[receipt token].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.get(path: "1/receipts/#{receipt}.json", query: { token: token }) end end |
#token ⇒ String
Returns application token to check for a receipt.
7 8 9 10 11 12 13 14 15 |
# File 'lib/pushover/receipt.rb', line 7 Receipt = Struct.new(:receipt, :token, keyword_init: true) do # Call pushover and return a response. # @return [Response] response for the receipt request def get %i[receipt token].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.get(path: "1/receipts/#{receipt}.json", query: { token: token }) end end |
Instance Method Details
#get ⇒ Response
Call pushover and return a response.
10 11 12 13 14 |
# File 'lib/pushover/receipt.rb', line 10 def get %i[receipt token].each { |param| raise "#{param} must be supplied" unless send param } Response.create_from_excon_response Excon.get(path: "1/receipts/#{receipt}.json", query: { token: token }) end |