Sha256: 8faf8370bf125b5a1c8d92f27a1087e1b588cf1202790dacb420037751b87506

Contents?: true

Size: 566 Bytes

Versions: 2

Compression:

Stored size: 566 Bytes

Contents

require "active_support/core_ext/module/attribute_accessors"
require "active_support/time"
require "groupdate/version"
require "groupdate/magic"

module Groupdate
  FIELDS = [:second, :minute, :hour, :day, :week, :month, :year, :day_of_week, :hour_of_day]
  METHODS = FIELDS.map{|v| :"group_by_#{v}" }

  mattr_accessor :week_start, :day_start, :time_zone
  self.week_start = :sun
  self.day_start = 0
end

require "groupdate/enumerable"
begin
  require "active_record"
rescue LoadError
  # do nothing
end
require "groupdate/active_record" if defined?(ActiveRecord)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
groupdate-2.2.1 lib/groupdate.rb
groupdate-2.2.0 lib/groupdate.rb