Class: Conductor::Worker::Events::HttpApiRequest

Inherits:
ConductorEvent show all
Defined in:
lib/conductor/worker/events/http_events.rb

Instance Attribute Summary collapse

Attributes inherited from ConductorEvent

#timestamp

Instance Method Summary collapse

Constructor Details

#initialize(method:, uri:, status:, duration_ms:) ⇒ HttpApiRequest

Returns a new instance of HttpApiRequest.



11
12
13
14
15
16
17
# File 'lib/conductor/worker/events/http_events.rb', line 11

def initialize(method:, uri:, status:, duration_ms:)
  super()
  @method = method.to_s.upcase
  @uri = uri.to_s
  @status = status.to_s
  @duration_ms = duration_ms
end

Instance Attribute Details

#duration_msObject (readonly)

Returns the value of attribute duration_ms.



9
10
11
# File 'lib/conductor/worker/events/http_events.rb', line 9

def duration_ms
  @duration_ms
end

#methodObject (readonly)

Returns the value of attribute method.



9
10
11
# File 'lib/conductor/worker/events/http_events.rb', line 9

def method
  @method
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/conductor/worker/events/http_events.rb', line 9

def status
  @status
end

#uriObject (readonly)

Returns the value of attribute uri.



9
10
11
# File 'lib/conductor/worker/events/http_events.rb', line 9

def uri
  @uri
end

Instance Method Details

#to_hObject



19
20
21
# File 'lib/conductor/worker/events/http_events.rb', line 19

def to_h
  super.merge(method: @method, uri: @uri, status: @status, duration_ms: @duration_ms)
end