Class: Appsignal::Marker
- Inherits:
-
Object
- Object
- Appsignal::Marker
- Defined in:
- lib/appsignal/marker.rb
Constant Summary collapse
- ACTION =
'markers'
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#marker_data ⇒ Object
readonly
Returns the value of attribute marker_data.
Instance Method Summary collapse
-
#initialize(marker_data, config) ⇒ Marker
constructor
A new instance of Marker.
- #transmit ⇒ Object
Constructor Details
#initialize(marker_data, config) ⇒ Marker
Returns a new instance of Marker.
6 7 8 9 |
# File 'lib/appsignal/marker.rb', line 6 def initialize(marker_data, config) @marker_data = marker_data @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/appsignal/marker.rb', line 3 def config @config end |
#marker_data ⇒ Object (readonly)
Returns the value of attribute marker_data.
3 4 5 |
# File 'lib/appsignal/marker.rb', line 3 def marker_data @marker_data end |
Instance Method Details
#transmit ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/appsignal/marker.rb', line 11 def transmit transmitter = Transmitter.new(ACTION, config) puts "Notifying Appsignal of deploy with: revision: #{marker_data[:revision]}, user: #{marker_data[:user]}" result = transmitter.transmit(marker_data) if result == '200' puts 'Appsignal has been notified of this deploy!' else raise "#{result} at #{transmitter.uri}" end rescue Exception => e puts "Something went wrong while trying to notify Appsignal: #{e}" end |