Class: Appsignal::Transmitter
- Inherits:
-
Object
- Object
- Appsignal::Transmitter
- Defined in:
- lib/appsignal/transmitter.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
Instance Method Summary collapse
-
#initialize(endpoint, action, api_key, logger = nil) ⇒ Transmitter
constructor
A new instance of Transmitter.
- #transmit(payload) ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(endpoint, action, api_key, logger = nil) ⇒ Transmitter
Returns a new instance of Transmitter.
11 12 13 14 15 |
# File 'lib/appsignal/transmitter.rb', line 11 def initialize(endpoint, action, api_key, logger=nil) @endpoint = endpoint @action = action @api_key = api_key end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
9 10 11 |
# File 'lib/appsignal/transmitter.rb', line 9 def action @action end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/appsignal/transmitter.rb', line 9 def api_key @api_key end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
9 10 11 |
# File 'lib/appsignal/transmitter.rb', line 9 def endpoint @endpoint end |
Instance Method Details
#transmit(payload) ⇒ Object
27 28 29 |
# File 'lib/appsignal/transmitter.rb', line 27 def transmit(payload) http_client.request(http_post(payload)).code end |