Sha256: 2a30f8304e4e100c7a46e3a26805cf4ff90226c879c97ec491b1e24f8b9cf0f2

Contents?: true

Size: 426 Bytes

Versions: 142

Compression:

Stored size: 426 Bytes

Contents

# frozen_string_literal: true

require "age_calculator"

module Renalware
  class AutomaticAgeCalculator
    def initialize(age, born_on:, age_on_date:)
      @age = age
      @born_on = born_on
      @age_on_date = age_on_date
    end

    def compute
      if @born_on.present?
        parts = AgeCalculator.new.compute(@born_on, @age_on_date)
        Age.new_from(parts)
      else
        @age
      end
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.127 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.126 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.125 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.124 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.123 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.121 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.120 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.119 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.118 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.117 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.116 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.115 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.113 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.112 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.111 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.110 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.109 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.108 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.106 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.105 lib/renalware/automatic_age_calculator.rb