Class: Huckleberry::Importer
- Inherits:
-
Object
- Object
- Huckleberry::Importer
- Defined in:
- lib/huckleberry/importer.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #import ⇒ Object
-
#initialize(directory = "tmp/usda", version = "sr27") ⇒ Importer
constructor
A new instance of Importer.
Constructor Details
#initialize(directory = "tmp/usda", version = "sr27") ⇒ Importer
Returns a new instance of Importer.
5 6 7 8 |
# File 'lib/huckleberry/importer.rb', line 5 def initialize(directory = "tmp/usda", version = "sr27") @directory = directory @version = version end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
3 4 5 |
# File 'lib/huckleberry/importer.rb', line 3 def directory @directory end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/huckleberry/importer.rb', line 3 def version @version end |
Instance Method Details
#import ⇒ Object
10 11 12 13 14 15 |
# File 'lib/huckleberry/importer.rb', line 10 def import downloader.download_and_unzip importer_names.each { |importer_name| importer_for(importer_name).import } ensure downloader.cleanup end |