Sha256: d2ad2eed191e0e0eadb753b1a48dc4643d01cecf719f3fc0de2be0d04a5054e1

Contents?: true

Size: 1014 Bytes

Versions: 4

Compression:

Stored size: 1014 Bytes

Contents

module Timeliness
  class Configuration
    # Default timezone. Options:
    #   - :local (default)
    #   - :utc
    #   
    #   If ActiveSupport loaded, also
    #   - :current
    #   - 'Zone name'
    #
    attr_accessor :default_timezone 

    # Set the default date part for a time type values.
    #
    attr_accessor :date_for_time_type

    # Default parsing of ambiguous date formats. Options:
    #   - :us (default, 01/02/2000 = 2nd of January 2000)
    #   - :euro (01/02/2000 = 1st of February 2000)
    #
    attr_accessor :ambiguous_date_format

    # Set the threshold value for a two digit year to be considered last century
    #
    # Default: 30
    #
    #   Example:
    #     year = '29' is considered 2029
    #     year = '30' is considered 1930
    #
    attr_accessor :ambiguous_year_threshold

    def initialize
      @default_timezone = :local
      @date_for_time_type = lambda { Time.now }
      @ambiguous_date_format = :us
      @ambiguous_year_threshold = 30
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
timeliness-0.5.0 lib/timeliness/configuration.rb
timeliness-0.4.5 lib/timeliness/configuration.rb
timeliness-0.4.4 lib/timeliness/configuration.rb
timeliness-0.4.3 lib/timeliness/configuration.rb