Class: Io::Flow::V0::Models::CustomerAddressType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CustomerAddressType
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of CustomerAddressType for this value, creating a new instance for an unknown value.
- .billing ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of CustomerAddressType for this value, or nil if not found.
- .invoice ⇒ Object
- .shipping ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ CustomerAddressType
constructor
A new instance of CustomerAddressType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CustomerAddressType
Returns a new instance of CustomerAddressType.
13802 13803 13804 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13802 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13800 13801 13802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13800 def value @value end |
Class Method Details
.ALL ⇒ Object
13822 13823 13824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13822 def CustomerAddressType.ALL @@all ||= [CustomerAddressType.billing, CustomerAddressType.invoice, CustomerAddressType.shipping] end |
.apply(value) ⇒ Object
Returns the instance of CustomerAddressType for this value, creating a new instance for an unknown value
13807 13808 13809 13810 13811 13812 13813 13814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13807 def CustomerAddressType.apply(value) if value.instance_of?(CustomerAddressType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CustomerAddressType.new(value)) end end |
.billing ⇒ Object
13826 13827 13828 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13826 def CustomerAddressType.billing @@_billing ||= CustomerAddressType.new('billing') end |
.from_string(value) ⇒ Object
Returns the instance of CustomerAddressType for this value, or nil if not found
13817 13818 13819 13820 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13817 def CustomerAddressType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CustomerAddressType.ALL.find { |v| v.value == value } end |
.invoice ⇒ Object
13830 13831 13832 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13830 def CustomerAddressType.invoice @@_invoice ||= CustomerAddressType.new('invoice') end |
.shipping ⇒ Object
13834 13835 13836 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13834 def CustomerAddressType.shipping @@_shipping ||= CustomerAddressType.new('shipping') end |
Instance Method Details
#to_hash ⇒ Object
13838 13839 13840 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13838 def to_hash value end |