Sha256: 8b4864dc5db85cc19bc1f8006215bb17a808fa3c89c3e6ab0cfdf200167cb740

Contents?: true

Size: 427 Bytes

Versions: 2

Compression:

Stored size: 427 Bytes

Contents

class QuarterBoundaryDate < Date
  # args for Date#new are year, month, day, and an optional "day of calendar reform"
  # just not gonna worry about day of calendar reform at all.
  def self.new(*args)
    args.unshift(this_year) if args.size < 2
    super(*args)
  end
end

class QuarterBeginDate < QuarterBoundaryDate
  
end

class QuarterEndDate   < QuarterBoundaryDate
  def self.new(*args)
    super.end_of_month
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quarter_system-0.1.2 lib/quarter_system/quarter_boundary_date.rb
quarter_system-0.1.1 lib/quarter_system/quarter_boundary_date.rb