Sha256: a83f451ec75247d31daf7b4b492fac53acd6cddbae5522fc881e1492a50576c5

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

module Xirr
  include ActiveSupport::Configurable

  # Sets as constants all the entries in the Hash Default values
  default_values = {
      eps: '1.0e-6'.to_f,
      days_in_year: 365,
      iteration_limit: 50,
      precision: 6,
      default_method: :bisection,
      fallback: true
  }

  # Iterates trhough default values and sets in config
  default_values.each do |key, value|
    self.config.send("#{key.to_sym}=", value)
    const_set key.to_s.upcase.to_sym, value
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xirr-0.3.0 lib/xirr/config.rb
xirr-0.2.9 lib/xirr/config.rb
xirr-0.2.8 lib/xirr/config.rb
xirr-0.2.7 lib/xirr/config.rb