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.



14589
14590
14591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14589

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14587
14588
14589
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14587

def value
  @value
end

Class Method Details

.ALLObject



14609
14610
14611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14609

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



14594
14595
14596
14597
14598
14599
14600
14601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14594

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



14613
14614
14615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14613

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



14604
14605
14606
14607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14604

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

.ratecardObject



14617
14618
14619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14617

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

Instance Method Details

#to_hashObject



14621
14622
14623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14621

def to_hash
  value
end