Sha256: 31931e3e49219f06ad03a3d0a4ea9dc2dd957d13206da4f861c4c890daea24e5

Contents?: true

Size: 772 Bytes

Versions: 2

Compression:

Stored size: 772 Bytes

Contents

module RailsClientTimezone  
  class Setting
   class << self
      attr_writer :baseline_year
      attr_writer :mode
      attr_writer :geoip_data_path
      
      #Possible mode values - :ip, :browser, :smart
      def mode
        @mode ||= :smart 
      end
      
      def geoip_data_path
        @geoip_data_path ||= File.expand_path(File.join(File.dirname(__FILE__), '../..', 'data/geoip', 'GeoLiteCity.dat'))
      end
      
      def baseline_year
        @baseline_year ||= 2011
      end
      
      def mid_summer_date_str
        "#{year}-6-21"
      end
      
      def mid_winter_date_str
        "#{year}-12-21"
      end
      
      def year
        (baseline_year.to_sym == :current) ? Time.zone.now.year : baseline_year
      end
   end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_client_timezone-0.9.0 lib/rails_client_timezone/setting.rb
rails_client_timezone-0.7.0 lib/rails_client_timezone/setting.rb