Class: Appsignal::Transmitter
- Inherits:
-
Object
- Object
- Appsignal::Transmitter
- Defined in:
- lib/appsignal/transmitter.rb
Constant Summary collapse
- CONTENT_TYPE =
'application/json; charset=UTF-8'.freeze
- CONTENT_ENCODING =
'gzip'.freeze
- CA_FILE_PATH =
File. (File.join(__FILE__, '../../../resources/cacert.pem'))
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.
15 16 17 18 19 |
# File 'lib/appsignal/transmitter.rb', line 15 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.
13 14 15 |
# File 'lib/appsignal/transmitter.rb', line 13 def action @action end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
13 14 15 |
# File 'lib/appsignal/transmitter.rb', line 13 def api_key @api_key end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
13 14 15 |
# File 'lib/appsignal/transmitter.rb', line 13 def endpoint @endpoint end |
Instance Method Details
#transmit(payload) ⇒ Object
31 32 33 |
# File 'lib/appsignal/transmitter.rb', line 31 def transmit(payload) http_client.request(http_post(payload)).code end |