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.
15696 15697 15698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15696 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15694 15695 15696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15694 def value @value end |
Class Method Details
.ALL ⇒ Object
15716 15717 15718 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15716 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
15701 15702 15703 15704 15705 15706 15707 15708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15701 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
15724 15725 15726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15724 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
15711 15712 15713 15714 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15711 def LevyStrategy.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LevyStrategy.ALL.find { |v| v.value == value } end |
.maximum ⇒ Object
15728 15729 15730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15728 def LevyStrategy.maximum @@_maximum ||= LevyStrategy.new('maximum') end |
.minimum ⇒ Object
15720 15721 15722 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15720 def LevyStrategy.minimum @@_minimum ||= LevyStrategy.new('minimum') end |
Instance Method Details
#to_hash ⇒ Object
15732 15733 15734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15732 def to_hash value end |