Class: Io::Flow::V0::Models::DeliveryOptionCostDetailSource

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

Returns a new instance of DeliveryOptionCostDetailSource.



16624
16625
16626
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16624

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16622
16623
16624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16622

def value
  @value
end

Class Method Details

.ALLObject



16644
16645
16646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16644

def DeliveryOptionCostDetailSource.ALL
  @@all ||= [DeliveryOptionCostDetailSource.center, DeliveryOptionCostDetailSource.ratecard]
end

.apply(value) ⇒ Object

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



16629
16630
16631
16632
16633
16634
16635
16636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16629

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

.centerObject



16648
16649
16650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16648

def DeliveryOptionCostDetailSource.center
  @@_center ||= DeliveryOptionCostDetailSource.new('center')
end

.from_string(value) ⇒ Object

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



16639
16640
16641
16642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16639

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

.ratecardObject



16652
16653
16654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16652

def DeliveryOptionCostDetailSource.ratecard
  @@_ratecard ||= DeliveryOptionCostDetailSource.new('ratecard')
end

Instance Method Details

#to_hashObject



16656
16657
16658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16656

def to_hash
  value
end