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.



23458
23459
23460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23458

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23456
23457
23458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23456

def value
  @value
end

Class Method Details

.ALLObject



23478
23479
23480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23478

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



23463
23464
23465
23466
23467
23468
23469
23470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23463

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



23473
23474
23475
23476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23473

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

.shippingObject



23482
23483
23484
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23482

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

Instance Method Details

#to_hashObject



23486
23487
23488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23486

def to_hash
  value
end