Class: BayonetClient::BayonetResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/bayonet_client/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parsed_response) ⇒ BayonetResponse

Returns a new instance of BayonetResponse.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/bayonet_client/response.rb', line 11

def initialize(parsed_response)

  if parsed_response.key?('rules_triggered')
    self.rules_triggered = parsed_response['rules_triggered']
  end
  if parsed_response.key?('decision')
    self.decision = parsed_response['decision']
  end
  if parsed_response.key?('bayonet_tracking_id')
    self.bayonet_tracking_id = parsed_response['bayonet_tracking_id']
  end
  if parsed_response.key?('payload')
    self.payload = parsed_response['payload']
  end
  if parsed_response.key?('reason_code')
    self.reason_code = parsed_response['reason_code']
  end
  if parsed_response.key?('reason_message')
    self.reason_message = parsed_response['reason_message']
  end
  if parsed_response.key?('request_body')
    self.request_body = parsed_response['request_body']
  end
  if parsed_response.key?('bayonet_fingerprint')
    self.bayonet_fingerprint = parsed_response['bayonet_fingerprint']
  end
  self.raw = parsed_response
end

Instance Attribute Details

#bayonet_fingerprintObject

Returns the value of attribute bayonet_fingerprint.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def bayonet_fingerprint
  @bayonet_fingerprint
end

#bayonet_tracking_idObject

Returns the value of attribute bayonet_tracking_id.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def bayonet_tracking_id
  @bayonet_tracking_id
end

#decisionObject

Returns the value of attribute decision.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def decision
  @decision
end

#payloadObject

Returns the value of attribute payload.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def payload
  @payload
end

#rawObject

Returns the value of attribute raw.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def raw
  @raw
end

#reason_codeObject

Returns the value of attribute reason_code.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def reason_code
  @reason_code
end

#reason_messageObject

Returns the value of attribute reason_message.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def reason_message
  @reason_message
end

#request_bodyObject

Returns the value of attribute request_body.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def request_body
  @request_body
end

#rules_triggeredObject

Returns the value of attribute rules_triggered.



6
7
8
# File 'lib/bayonet_client/response.rb', line 6

def rules_triggered
  @rules_triggered
end