class Golden::ApplicationCalculator

Public Class Methods

new(accessors = {}) click to toggle source
# File lib/golden/objects/application/application_calculator.rb, line 11
def initialize(accessors = {})
  assign_attributes(accessors || {})
end

Public Instance Methods

perform() click to toggle source
# File lib/golden/objects/application/application_calculator.rb, line 15
def perform
  raise NotImplementedError
end

Private Instance Methods

parse_decimal(value) click to toggle source
# File lib/golden/objects/application/application_calculator.rb, line 21
def parse_decimal(value)
  return value.to_d if value.respond_to? :to_d

  BigDecimal(value.presence || 0)
rescue ArgumentError
  BigDecimal(0)
end