Class: Firebell::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/firebell/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tokenObject

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