Class: SpatialFeatures::Importers::Base
- Inherits:
-
Object
- Object
- SpatialFeatures::Importers::Base
- Defined in:
- lib/spatial_features/importers/base.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Class Method Summary collapse
-
.create_all(data, **options) ⇒ Object
factory method that should always be used instead of ‘new` when creating importers returns an array of Importer::* objects.
Instance Method Summary collapse
- #cache_key ⇒ Object
- #features ⇒ Object
-
#initialize(data, make_valid: false, tmpdir: nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(data, make_valid: false, tmpdir: nil) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/spatial_features/importers/base.rb', line 8 def initialize(data, make_valid: false, tmpdir: nil) @make_valid = make_valid @data = data @errors = [] @tmpdir = tmpdir end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/spatial_features/importers/base.rb', line 6 def errors @errors end |
Class Method Details
.create_all(data, **options) ⇒ Object
factory method that should always be used instead of ‘new` when creating importers returns an array of Importer::* objects
25 26 27 |
# File 'lib/spatial_features/importers/base.rb', line 25 def self.create_all(data, **) [new(data, **)] end |
Instance Method Details
#cache_key ⇒ Object
19 20 21 |
# File 'lib/spatial_features/importers/base.rb', line 19 def cache_key @cache_key ||= Digest::MD5.hexdigest(@data) end |
#features ⇒ Object
15 16 17 |
# File 'lib/spatial_features/importers/base.rb', line 15 def features @features ||= build_features end |