Class: Firebell::Client
- Inherits:
-
Object
- Object
- Firebell::Client
- Defined in:
- lib/firebell/client.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token = Firebell.configuration.token) ⇒ Client
constructor
A new instance of Client.
- #notify(tag:, body: nil, params: {}) ⇒ Object
Constructor Details
#initialize(token = Firebell.configuration.token) ⇒ Client
Returns a new instance of Client.
7 8 9 |
# File 'lib/firebell/client.rb', line 7 def initialize(token = Firebell.configuration.token) @token = token end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/firebell/client.rb', line 5 def token @token end |
Instance Method Details
#notify(tag:, body: nil, params: {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/firebell/client.rb', line 11 def notify(tag:, body: nil, params: {}) attributes = { tag: tag } attributes.merge!(params: params) if params.any? attributes.merge!(body: body) if body send_request attributes if requestable? end |