Module: EdinetCode
- Defined in:
- lib/edinet_code.rb,
lib/edinet_code/reader.rb,
lib/edinet_code/archive.rb,
lib/edinet_code/version.rb,
lib/edinet_code/exception.rb,
lib/edinet_code/downloader.rb
Defined Under Namespace
Classes: Archive, Downloader, PropertyError, Reader
Constant Summary
collapse
- VERSION =
"0.0.1"
Class Method Summary
collapse
Class Method Details
.get(headless = true) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/edinet_code.rb', line 19
def get(headless=true)
download_dir = File.join(Dir.tmpdir, 'edinet_code')
download_path = File.join(download_dir, "Edinetcode_#{Date.today.strftime("%Y%m%d")}.zip")
if headless
Headless.ly do
Downloader.fetch(download_path)
end
else
Downloader.fetch(download_path)
end
uncompress_file_path = Archive.unzip(download_path)
Reader.csv(uncompress_file_path)
end
|
.get_code_exists(headless = true) ⇒ Object
34
35
36
37
|
# File 'lib/edinet_code.rb', line 34
def get_code_exists(headless=true)
vals = get(headless)
vals.delete_if{|val| val.code == ""}
end
|