Class: Raven::Client
- Inherits:
-
Object
- Object
- Raven::Client
- Defined in:
- lib/raven/client.rb
Constant Summary collapse
- PROTOCOL_VERSION =
'3'
- USER_AGENT =
"raven-ruby/#{Raven::VERSION}"
- CONTENT_TYPE =
'application/json'
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Client
constructor
A new instance of Client.
- #send(event) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ Client
Returns a new instance of Client.
19 20 21 |
# File 'lib/raven/client.rb', line 19 def initialize(configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
17 18 19 |
# File 'lib/raven/client.rb', line 17 def configuration @configuration end |
Instance Method Details
#send(event) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/raven/client.rb', line 23 def send(event) return unless configuration.send_in_current_environment? # Set the project ID correctly event.project = self.configuration.project_id Raven.logger.debug "Sending event #{event.id} to Sentry" content_type, encoded_data = encode(event) transport.send(generate_auth_header(encoded_data), encoded_data, :content_type => content_type) end |