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.
10889 10890 10891 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10889 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10887 10888 10889 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10887 def value @value end |
Class Method Details
.ALL ⇒ Object
10909 10910 10911 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10909 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
10894 10895 10896 10897 10898 10899 10900 10901 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10894 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
10917 10918 10919 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10917 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
10904 10905 10906 10907 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10904 def LevyStrategy.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LevyStrategy.ALL.find { |v| v.value == value } end |
.maximum ⇒ Object
10921 10922 10923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10921 def LevyStrategy.maximum @@_maximum ||= LevyStrategy.new('maximum') end |
.minimum ⇒ Object
10913 10914 10915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10913 def LevyStrategy.minimum @@_minimum ||= LevyStrategy.new('minimum') end |
Instance Method Details
#to_hash ⇒ Object
10925 10926 10927 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10925 def to_hash value end |