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.



10892
10893
10894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10892

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10890
10891
10892
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10890

def value
  @value
end

Class Method Details

.ALLObject



10912
10913
10914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10912

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



10897
10898
10899
10900
10901
10902
10903
10904
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10897

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



10916
10917
10918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10916

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



10907
10908
10909
10910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10907

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

.ratecardObject



10920
10921
10922
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10920

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

Instance Method Details

#to_hashObject



10924
10925
10926
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10924

def to_hash
  value
end