Sha256: 813f129470ac9f613107203c3d22ce1c5fdfe4da4f0b4ee320c899ee0dc692f9

Contents?: true

Size: 501 Bytes

Versions: 225

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literal: true

require "active_support/duration"
require "active_support/core_ext/numeric/time"

class Integer
  # Returns a Duration instance matching the number of months provided.
  #
  #   2.months # => 2 months
  def months
    ActiveSupport::Duration.months(self)
  end
  alias :month :months

  # Returns a Duration instance matching the number of years provided.
  #
  #   2.years # => 2 years
  def years
    ActiveSupport::Duration.years(self)
  end
  alias :year :years
end

Version data entries

225 entries across 210 versions & 25 rubygems

Version Path
omg-activesupport-8.0.0.alpha1 lib/active_support/core_ext/integer/time.rb
activesupport-7.1.4 lib/active_support/core_ext/integer/time.rb
activesupport-7.2.1 lib/active_support/core_ext/integer/time.rb
activesupport-7.2.0 lib/active_support/core_ext/integer/time.rb
activesupport-7.2.0.rc1 lib/active_support/core_ext/integer/time.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/integer/time.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.4/lib/active_support/core_ext/integer/time.rb
activesupport-7.2.0.beta3 lib/active_support/core_ext/integer/time.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/integer/time.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/integer/time.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/integer/time.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/integer/time.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/integer/time.rb
activesupport-7.2.0.beta2 lib/active_support/core_ext/integer/time.rb
activesupport-7.1.3.4 lib/active_support/core_ext/integer/time.rb
activesupport-7.0.8.4 lib/active_support/core_ext/integer/time.rb
activesupport-6.1.7.8 lib/active_support/core_ext/integer/time.rb
activesupport-7.2.0.beta1 lib/active_support/core_ext/integer/time.rb
activesupport-7.1.3.2 lib/active_support/core_ext/integer/time.rb
activesupport-7.1.3.1 lib/active_support/core_ext/integer/time.rb