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.



17347
17348
17349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17347

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17345
17346
17347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17345

def value
  @value
end

Class Method Details

.ALLObject



17367
17368
17369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17367

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



17352
17353
17354
17355
17356
17357
17358
17359
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17352

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



17371
17372
17373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17371

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



17362
17363
17364
17365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17362

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

.ratecardObject



17375
17376
17377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17375

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

Instance Method Details

#to_hashObject



17379
17380
17381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17379

def to_hash
  value
end