class Io::Flow::V0::Models::RoundingMethod

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 26342
def RoundingMethod.ALL
  @@all ||= [RoundingMethod.up, RoundingMethod.down, RoundingMethod.nearest]
end
apply(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 26327
def RoundingMethod.apply(value)
  if value.instance_of?(RoundingMethod)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || RoundingMethod.new(value))
  end
end
down() click to toggle source

Round down to the specified rounding.value

# File lib/flow_commerce/flow_api_v0_client.rb, line 26352
def RoundingMethod.down
  @@_down ||= RoundingMethod.new('down')
end
from_string(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 26337
def RoundingMethod.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  RoundingMethod.ALL.find { |v| v.value == value }
end
nearest() click to toggle source

Round to the nearest specified rounding.value. If equidistant, will round up.

# File lib/flow_commerce/flow_api_v0_client.rb, line 26357
def RoundingMethod.nearest
  @@_nearest ||= RoundingMethod.new('nearest')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 26322
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
up() click to toggle source

Round up to the specified rounding.value

# File lib/flow_commerce/flow_api_v0_client.rb, line 26347
def RoundingMethod.up
  @@_up ||= RoundingMethod.new('up')
end

Public Instance Methods

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