Class: EasyCompliance::Result
- Inherits:
-
Object
- Object
- EasyCompliance::Result
- Defined in:
- lib/easy_compliance/result.rb
Overview
result of an API call
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#hit? ⇒ Boolean
For methods 1-3.
-
#initialize(status:, body: nil) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(status:, body: nil) ⇒ Result
Returns a new instance of Result.
6 7 8 9 |
# File 'lib/easy_compliance/result.rb', line 6 def initialize(status:, body: nil) @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/easy_compliance/result.rb', line 4 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/easy_compliance/result.rb', line 4 def status @status end |
Instance Method Details
#hit? ⇒ Boolean
For methods 1-3. 204 means no hit. returns true if record was found on a sanctions lists, details in body.
13 14 15 |
# File 'lib/easy_compliance/result.rb', line 13 def hit? status == 200 end |