Class: Boppers::Notifier::Pushover
- Inherits:
-
Object
- Object
- Boppers::Notifier::Pushover
- Defined in:
- lib/boppers/notifier/pushover.rb
Constant Summary collapse
- ENDPOINT =
"https://api.pushover.net/1/messages.json"
Instance Attribute Summary collapse
-
#app_token ⇒ Object
readonly
Returns the value of attribute app_token.
-
#subscribe ⇒ Object
readonly
Returns the value of attribute subscribe.
-
#user_token ⇒ Object
readonly
Returns the value of attribute user_token.
Instance Method Summary collapse
- #call(title, message, _options) ⇒ Object
-
#initialize(app_token:, user_token:, subscribe: nil) ⇒ Pushover
constructor
A new instance of Pushover.
Constructor Details
#initialize(app_token:, user_token:, subscribe: nil) ⇒ Pushover
Returns a new instance of Pushover.
10 11 12 13 14 |
# File 'lib/boppers/notifier/pushover.rb', line 10 def initialize(app_token:, user_token:, subscribe: nil) @app_token = app_token @user_token = user_token @subscribe = subscribe end |
Instance Attribute Details
#app_token ⇒ Object (readonly)
Returns the value of attribute app_token.
8 9 10 |
# File 'lib/boppers/notifier/pushover.rb', line 8 def app_token @app_token end |
#subscribe ⇒ Object (readonly)
Returns the value of attribute subscribe.
8 9 10 |
# File 'lib/boppers/notifier/pushover.rb', line 8 def subscribe @subscribe end |
#user_token ⇒ Object (readonly)
Returns the value of attribute user_token.
8 9 10 |
# File 'lib/boppers/notifier/pushover.rb', line 8 def user_token @user_token end |
Instance Method Details
#call(title, message, _options) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/boppers/notifier/pushover.rb', line 16 def call(title, , ) HttpClient.post( ENDPOINT, token: app_token, user: user_token, title: title, message: ) end |