Class: Io::Flow::V0::Models::OrderQuoteAddressType

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) ⇒ OrderQuoteAddressType

Returns a new instance of OrderQuoteAddressType.



20654
20655
20656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20654

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20652
20653
20654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20652

def value
  @value
end

Class Method Details

.ALLObject



20674
20675
20676
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20674

def OrderQuoteAddressType.ALL
  @@all ||= [OrderQuoteAddressType.shipping]
end

.apply(value) ⇒ Object

Returns the instance of OrderQuoteAddressType for this value, creating a new instance for an unknown value



20659
20660
20661
20662
20663
20664
20665
20666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20659

def OrderQuoteAddressType.apply(value)
  if value.instance_of?(OrderQuoteAddressType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OrderQuoteAddressType.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of OrderQuoteAddressType for this value, or nil if not found



20669
20670
20671
20672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20669

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

.shippingObject



20678
20679
20680
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20678

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

Instance Method Details

#to_hashObject



20682
20683
20684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20682

def to_hash
  value
end