Class: Io::Flow::V0::Models::CostEstimateSource
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CostEstimateSource
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of CostEstimateSource for this value, creating a new instance for an unknown value.
-
.channel ⇒ Object
The channel partner calculated the estimated cost for the shipping label.
-
.flow ⇒ Object
Flow calculated the estimated cost for the shipping label.
-
.from_string(value) ⇒ Object
Returns the instance of CostEstimateSource for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ CostEstimateSource
constructor
A new instance of CostEstimateSource.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CostEstimateSource
Returns a new instance of CostEstimateSource.
18071 18072 18073 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18071 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18069 18070 18071 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18069 def value @value end |
Class Method Details
.ALL ⇒ Object
18091 18092 18093 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18091 def CostEstimateSource.ALL @@all ||= [CostEstimateSource.flow, CostEstimateSource.channel] end |
.apply(value) ⇒ Object
Returns the instance of CostEstimateSource for this value, creating a new instance for an unknown value
18076 18077 18078 18079 18080 18081 18082 18083 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18076 def CostEstimateSource.apply(value) if value.instance_of?(CostEstimateSource) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CostEstimateSource.new(value)) end end |
.channel ⇒ Object
The channel partner calculated the estimated cost for the shipping label
18101 18102 18103 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18101 def CostEstimateSource.channel @@_channel ||= CostEstimateSource.new('channel') end |
.flow ⇒ Object
Flow calculated the estimated cost for the shipping label
18096 18097 18098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18096 def CostEstimateSource.flow @@_flow ||= CostEstimateSource.new('flow') end |
.from_string(value) ⇒ Object
Returns the instance of CostEstimateSource for this value, or nil if not found
18086 18087 18088 18089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18086 def CostEstimateSource.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CostEstimateSource.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
18105 18106 18107 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18105 def to_hash value end |