Sha256: c3a95576c4b4493fc2a63d7a3baad836bac0520533dfd5727088d57e38fb4929

Contents?: true

Size: 435 Bytes

Versions: 2

Compression:

Stored size: 435 Bytes

Contents

module ByStar
  module RangeCalculations

    private
    
    def start_of_year(year=Time.now.year)
      Time.utc(year, 1, 1)
    end
    
    def end_of_year(year=Time.now.year)
      start_of_year.end_of_year
    end
    
    def start_of_month(month, year=Time.now.year)
      Time.utc(year, month, 1)
    end
    
    def end_of_month(month, year=Time.now.year)
      start_of_month(month, year).end_of_month
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
by_star-0.3.1 lib/range_calculations.rb
by_star-0.3.0 lib/range_calculations.rb