Class: Io::Flow::V0::Models::CustomerAddressType

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ CustomerAddressType

Returns a new instance of CustomerAddressType.



12829
12830
12831
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12829

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12827
12828
12829
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12827

def value
  @value
end

Class Method Details

.ALLObject



12849
12850
12851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12849

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



12834
12835
12836
12837
12838
12839
12840
12841
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12834

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

.billingObject



12853
12854
12855
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12853

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



12844
12845
12846
12847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12844

def CustomerAddressType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  CustomerAddressType.ALL.find { |v| v.value == value }
end

.invoiceObject



12857
12858
12859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12857

def CustomerAddressType.invoice
  @@_invoice ||= CustomerAddressType.new('invoice')
end

.shippingObject



12861
12862
12863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12861

def CustomerAddressType.shipping
  @@_shipping ||= CustomerAddressType.new('shipping')
end

Instance Method Details

#to_hashObject



12865
12866
12867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12865

def to_hash
  value
end