Class: Io::Flow::V0::Models::Avs
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Avs
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents the address verification results
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#postal ⇒ Object
readonly
Returns the value of attribute postal.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Avs
constructor
A new instance of Avs.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Avs
Returns a new instance of Avs.
13399 13400 13401 13402 13403 13404 13405 13406 13407 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13399 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code], 'Avs') @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AvsCode) ? x : ::Io::Flow::V0::Models::AvsCode.apply(x)) @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('name', x)) @address = (x = opts.delete(:address); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('address', x)) @postal = (x = opts.delete(:postal); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('postal', x)) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
13397 13398 13399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13397 def address @address end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
13397 13398 13399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13397 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
13397 13398 13399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13397 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13397 13398 13399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13397 def name @name end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
13397 13398 13399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13397 def postal @postal end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13413 13414 13415 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13413 def copy(incoming={}) Avs.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
13417 13418 13419 13420 13421 13422 13423 13424 13425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13417 def to_hash { :code => code.value, :name => name, :address => address, :postal => postal, :description => description } end |
#to_json ⇒ Object
13409 13410 13411 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13409 def to_json JSON.dump(to_hash) end |