Class: Io::Flow::V0::Models::LevyStrategy
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LevyStrategy
- 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 LevyStrategy for this value, creating a new instance for an unknown value.
- .average ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of LevyStrategy for this value, or nil if not found.
- .maximum ⇒ Object
- .minimum ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ LevyStrategy
constructor
A new instance of LevyStrategy.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ LevyStrategy
Returns a new instance of LevyStrategy.
9394 9395 9396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9394 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9392 9393 9394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9392 def value @value end |
Class Method Details
.ALL ⇒ Object
9414 9415 9416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9414 def LevyStrategy.ALL @@all ||= [LevyStrategy.minimum, LevyStrategy.average, LevyStrategy.maximum] end |
.apply(value) ⇒ Object
Returns the instance of LevyStrategy for this value, creating a new instance for an unknown value
9399 9400 9401 9402 9403 9404 9405 9406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9399 def LevyStrategy.apply(value) if value.instance_of?(LevyStrategy) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || LevyStrategy.new(value)) end end |
.average ⇒ Object
9422 9423 9424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9422 def LevyStrategy.average @@_average ||= LevyStrategy.new('average') end |
.from_string(value) ⇒ Object
Returns the instance of LevyStrategy for this value, or nil if not found
9409 9410 9411 9412 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9409 def LevyStrategy.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LevyStrategy.ALL.find { |v| v.value == value } end |
.maximum ⇒ Object
9426 9427 9428 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9426 def LevyStrategy.maximum @@_maximum ||= LevyStrategy.new('maximum') end |
.minimum ⇒ Object
9418 9419 9420 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9418 def LevyStrategy.minimum @@_minimum ||= LevyStrategy.new('minimum') end |
Instance Method Details
#to_hash ⇒ Object
9430 9431 9432 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9430 def to_hash value end |