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.



11363
11364
11365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11363

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11361
11362
11363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11361

def value
  @value
end

Class Method Details

.ALLObject



11383
11384
11385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11383

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



11368
11369
11370
11371
11372
11373
11374
11375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11368

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



11387
11388
11389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11387

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



11378
11379
11380
11381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11378

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

.ratecardObject



11391
11392
11393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11391

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

Instance Method Details

#to_hashObject



11395
11396
11397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11395

def to_hash
  value
end