Sha256: f47a51712817f706dec10cfc027158daac6de417db6f97b1db1f999f2a47584c

Contents?: true

Size: 711 Bytes

Versions: 6

Compression:

Stored size: 711 Bytes

Contents

class Date
  
  def start_of_frequency(freq)
    case freq.to_sym
    when :daily     then self
    when :weekly    then self.beginning_of_week
    when :monthly   then self.beginning_of_month
    when :quarterly then self.beginning_of_quarter
    when :annual    then self.beginning_of_year
    when :annually  then self.beginning_of_year
    else
      self
    end
  end
  
  def end_of_frequency(freq)
    case freq.to_sym
    when :daily     then self
    when :weekly    then self.end_of_week
    when :monthly   then self.end_of_month
    when :quarterly then self.end_of_quarter
    when :annual    then self.end_of_year
    when :annually  then self.end_of_year
    else
      self
    end
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
quandl_operation-0.1.12 lib/quandl/operation/core_ext/date.rb
quandl_operation-0.1.11 lib/quandl/operation/core_ext/date.rb
quandl_operation-0.1.10 lib/quandl/operation/core_ext/date.rb
quandl_operation-0.1.9 lib/quandl/operation/core_ext/date.rb
quandl_operation-0.1.8 lib/quandl/operation/core_ext/date.rb
quandl_operation-0.1.7 lib/quandl/operation/core_ext/date.rb