class Io::Flow::V0::Models::MeasurementSystem
Attributes
value[R]
Public Class Methods
ALL()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22390 def MeasurementSystem.ALL @@all ||= [MeasurementSystem.imperial, MeasurementSystem.metric] end
apply(value)
click to toggle source
Returns the instance of MeasurementSystem
for this value, creating a new instance for an unknown value
# File lib/flow_commerce/flow_api_v0_client.rb, line 22375 def MeasurementSystem.apply(value) if value.instance_of?(MeasurementSystem) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || MeasurementSystem.new(value)) end end
from_string(value)
click to toggle source
Returns the instance of MeasurementSystem
for this value, or nil if not found
# File lib/flow_commerce/flow_api_v0_client.rb, line 22385 def MeasurementSystem.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) MeasurementSystem.ALL.find { |v| v.value == value } end
imperial()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22394 def MeasurementSystem.imperial @@_imperial ||= MeasurementSystem.new('imperial') end
metric()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22398 def MeasurementSystem.metric @@_metric ||= MeasurementSystem.new('metric') end
new(value)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22370 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end
Public Instance Methods
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22402 def to_hash value end