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.
9484 9485 9486 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9484 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9482 9483 9484 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9482 def value @value end |
Class Method Details
.ALL ⇒ Object
9504 9505 9506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9504 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
9489 9490 9491 9492 9493 9494 9495 9496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9489 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
9512 9513 9514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9512 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
9499 9500 9501 9502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9499 def LevyStrategy.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LevyStrategy.ALL.find { |v| v.value == value } end |
.maximum ⇒ Object
9516 9517 9518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9516 def LevyStrategy.maximum @@_maximum ||= LevyStrategy.new('maximum') end |
.minimum ⇒ Object
9508 9509 9510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9508 def LevyStrategy.minimum @@_minimum ||= LevyStrategy.new('minimum') end |
Instance Method Details
#to_hash ⇒ Object
9520 9521 9522 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9520 def to_hash value end |