Class: Io::Flow::V0::Models::CardSummary
- Inherits:
-
ExpandableCard
- Object
- ExpandableCard
- Io::Flow::V0::Models::CardSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Card Summary is the card without the token
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#expiration ⇒ Object
readonly
Returns the value of attribute expiration.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#iin ⇒ Object
readonly
Returns the value of attribute iin.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#last4 ⇒ Object
readonly
Returns the value of attribute last4.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from ExpandableCard
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardSummary
constructor
A new instance of CardSummary.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ExpandableCard
Constructor Details
#initialize(incoming = {}) ⇒ CardSummary
Returns a new instance of CardSummary.
33666 33667 33668 33669 33670 33671 33672 33673 33674 33675 33676 33677 33678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33666 def initialize(incoming={}) super(:discriminator => ExpandableCard::Types::CARD_SUMMARY) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :type, :expiration, :iin, :last4, :name], 'CardSummary') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::CardType) ? x : ::Io::Flow::V0::Models::CardType.apply(x)) @expiration = (x = opts.delete(:expiration); x.is_a?(::Io::Flow::V0::Models::Expiration) ? x : ::Io::Flow::V0::Models::Expiration.new(x)) @iin = HttpClient::Preconditions.assert_class('iin', opts.delete(:iin), String) @issuer = (x = opts.delete(:issuer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::IssuerSummary) ? x : ::Io::Flow::V0::Models::IssuerSummary.new(x))) @last4 = HttpClient::Preconditions.assert_class('last4', opts.delete(:last4), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x))) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def address @address end |
#expiration ⇒ Object (readonly)
Returns the value of attribute expiration.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def expiration @expiration end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def id @id end |
#iin ⇒ Object (readonly)
Returns the value of attribute iin.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def iin @iin end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def issuer @issuer end |
#last4 ⇒ Object (readonly)
Returns the value of attribute last4.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def last4 @last4 end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
33664 33665 33666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33664 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33684 33685 33686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33684 def copy(incoming={}) CardSummary.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
33688 33689 33690 33691 33692 33693 33694 33695 33696 33697 33698 33699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33688 def subtype_to_hash { :id => id, :type => type.value, :expiration => expiration.to_hash, :iin => iin, :issuer => issuer.nil? ? nil : issuer.to_hash, :last4 => last4, :name => name, :address => address.nil? ? nil : address.to_hash } end |
#to_json ⇒ Object
33680 33681 33682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33680 def to_json JSON.dump(to_hash) end |