class Io::Flow::V0::Models::LevyStrategy

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22198
def LevyStrategy.ALL
  @@all ||= [LevyStrategy.minimum, LevyStrategy.average, LevyStrategy.maximum]
end
apply(value) click to toggle source

Returns the instance of LevyStrategy for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 22183
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() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22206
def LevyStrategy.average
  @@_average ||= LevyStrategy.new('average')
end
from_string(value) click to toggle source

Returns the instance of LevyStrategy for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 22193
def LevyStrategy.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  LevyStrategy.ALL.find { |v| v.value == value }
end
maximum() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22210
def LevyStrategy.maximum
  @@_maximum ||= LevyStrategy.new('maximum')
end
minimum() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22202
def LevyStrategy.minimum
  @@_minimum ||= LevyStrategy.new('minimum')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22178
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 22214
def to_hash
  value
end