Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/sec_query/sec_uri.rb

Instance Method Summary collapse

Instance Method Details

#quarterObject



4
5
6
# File 'lib/sec_query/sec_uri.rb', line 4

def quarter
  ((month / 3.0) - 0.1).floor + 1
end

#to_sec_uri_formatObject



8
9
10
11
12
13
14
15
# File 'lib/sec_query/sec_uri.rb', line 8

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