class Date

Public Instance Methods

quarter() click to toggle source
# File lib/sec_edgar/utils.rb, line 16
def quarter
  ((month / 3.0) - 0.1).floor + 1
end
to_sec_uri_format() click to toggle source
# File lib/sec_edgar/utils.rb, line 20
def to_sec_uri_format
  today = Date.today
  if today.quarter == quarter && today.year == year
    "company.#{ strftime("%Y%m%d") }.idx"
  else
    "#{ year }/QTR#{ quarter }/company.#{ strftime("%Y%m%d") }.idx"
  end
end