Class: VerifIP::ReportResponse
- Inherits:
-
Object
- Object
- VerifIP::ReportResponse
- Defined in:
- lib/verifip/models.rb
Overview
Response from a fraud report submission.
Constant Summary collapse
- FIELDS =
%i[request_id status message].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ ReportResponse
constructor
A new instance of ReportResponse.
- #inspect ⇒ Object
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ ReportResponse
Returns a new instance of ReportResponse.
297 298 299 300 301 |
# File 'lib/verifip/models.rb', line 297 def initialize(**kwargs) @request_id = kwargs.fetch(:request_id, "") @status = kwargs.fetch(:status, "") @message = kwargs.fetch(:message, "") end |
Class Method Details
.from_hash(hash) ⇒ Object
303 304 305 306 |
# File 'lib/verifip/models.rb', line 303 def self.from_hash(hash) hash = _symbolize(hash) new(**hash.slice(*FIELDS)) end |
Instance Method Details
#inspect ⇒ Object
313 |
# File 'lib/verifip/models.rb', line 313 def inspect = to_s |
#to_h ⇒ Object
308 309 310 |
# File 'lib/verifip/models.rb', line 308 def to_h FIELDS.each_with_object({}) { |f, h| h[f] = send(f) } end |
#to_s ⇒ Object
312 |
# File 'lib/verifip/models.rb', line 312 def to_s = "ReportResponse(status=#{@status}, message=#{@message})" |