Sha256: fa1a4f79a468eab599aef198371691b7222ef1335e1b896e942f82b416b71fbb

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true
require_relative "./unified_message"
require_relative "./response_code"
class ResponseMessage
  include Serdee::Attributes
  serialize_key { |key| key.camelize(:lower) }
  deserialize_key { |key| key.underscore }

  attr_accessor :request_id

  nested :response, UnifiedMessage

  def parsed_message?
    status_code == "00" if status_code
  end

  def status
    return unless response_code
    @status ||= ResponseCode.find(response_code)
  end

  def approved?
    status&.approved?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
serdee-0.2.0 examples/response_message.rb