Method: SecQuery::Filing.for_cik

Defined in:
lib/sec_query/filing.rb

.for_cik(cik, options = {}, &blk) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/sec_query/filing.rb', line 36

def self.for_cik(cik, options = {}, &blk)
  start = options.fetch(:start, 0)
  count = options.fetch(:count, 100)
  limit = options.fetch(:limit, 100)
  fetch(uri_for_cik(cik, start, count), &blk)
  start += count
  return if start >= limit
  for_cik(cik, { start: start, count: count, limit: limit }, &blk)
rescue OpenURI::HTTPError
  return
end