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.



13857
13858
13859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13857

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13855
13856
13857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13855

def value
  @value
end

Class Method Details

.ALLObject



13877
13878
13879
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13877

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



13862
13863
13864
13865
13866
13867
13868
13869
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13862

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



13881
13882
13883
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13881

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



13872
13873
13874
13875
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13872

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

.ratecardObject



13885
13886
13887
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13885

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

Instance Method Details

#to_hashObject



13889
13890
13891
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13889

def to_hash
  value
end