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.1.1 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.1.0 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.167 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.166 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.165 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.164 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.163 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.162 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.161 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.160 app/models/renalware/automatic_age_calculator.rb
renalware-core-2.0.159 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.158 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.157 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.156 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.155 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.153 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.152 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.151 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.149 lib/renalware/automatic_age_calculator.rb
renalware-core-2.0.148 lib/renalware/automatic_age_calculator.rb