Sha256: 8d32c0178e7d178c45cfc4e5403c45afb0ffd983c445dd87c45df30fbbb7d205

Contents?: true

Size: 317 Bytes

Versions: 3

Compression:

Stored size: 317 Bytes

Contents

# encoding: utf-8

# Extend Date with methods to find the previous Date
class Date

  unless method_defined?(:pred)
    # Decrement the Date by one day
    #
    # @example
    #   previous_day = date.pred
    #
    # @return [Date]
    #
    # @api public
    def pred
      self - 1
    end
  end

end # class Date

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
axiom-0.2.0 lib/axiom/core_ext/date.rb
axiom-0.1.1 lib/axiom/core_ext/date.rb
axiom-0.1.0 lib/axiom/core_ext/date.rb