Class: Io::Flow::V0::Models::CvvResult

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CvvResult

Returns a new instance of CvvResult.



38745
38746
38747
38748
38749
38750
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38745

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:code], 'CvvResult')
  @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::CvvResultCode) ? x : ::Io::Flow::V0::Models::CvvResultCode.apply(x))
  @raw = (x = opts.delete(:raw); x.nil? ? nil : HttpClient::Preconditions.assert_class('raw', x, String))
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



38743
38744
38745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38743

def code
  @code
end

#rawObject (readonly)

Returns the value of attribute raw.



38743
38744
38745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38743

def raw
  @raw
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38756
38757
38758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38756

def copy(incoming={})
  CvvResult.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



38760
38761
38762
38763
38764
38765
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38760

def to_hash
  {
    :code => code.value,
    :raw => raw
  }
end

#to_jsonObject



38752
38753
38754
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38752

def to_json
  JSON.dump(to_hash)
end