Class: TicketAbstractorClient::CommunicationData

Inherits:
Object
  • Object
show all
Defined in:
lib/ticket_abstractor_client/communication_data.rb

Constant Summary collapse

BINARY_RESPONSE_TEXT =
'Binary content'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommunicationData

Returns a new instance of CommunicationData.



8
9
10
# File 'lib/ticket_abstractor_client/communication_data.rb', line 8

def initialize
  @binary_response = false
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def args
  @args
end

#executed_atObject

Returns the value of attribute executed_at.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def executed_at
  @executed_at
end

#methodObject

Returns the value of attribute method.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def method
  @method
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def path
  @path
end

#responseObject

Returns the value of attribute response.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def response
  @response
end

#ta_response_timeObject

Returns the value of attribute ta_response_time.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def ta_response_time
  @ta_response_time
end

#total_response_timeObject

Returns the value of attribute total_response_time.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def total_response_time
  @total_response_time
end

#ts_response_timeObject

Returns the value of attribute ts_response_time.



3
4
5
# File 'lib/ticket_abstractor_client/communication_data.rb', line 3

def ts_response_time
  @ts_response_time
end

Instance Method Details

#binary_response!Object



12
13
14
# File 'lib/ticket_abstractor_client/communication_data.rb', line 12

def binary_response!
  @binary_response = true
end

#binary_response?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ticket_abstractor_client/communication_data.rb', line 16

def binary_response?
  @binary_response
end

#to_hObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ticket_abstractor_client/communication_data.rb', line 26

def to_h
  {
    method: self.method,
    path: self.path,
    args: self.args,
    response: self.response,
    executed_at: self.executed_at,
    total_response_time: self.total_response_time,
    ta_response_time: self.ta_response_time,
    ts_response_time: self.ts_response_time
  }
end

#to_jsonObject



39
40
41
# File 'lib/ticket_abstractor_client/communication_data.rb', line 39

def to_json
  self.to_h.to_json
end