Exception: SpatialFeatures::Unzip::PathNotFound
- Inherits:
-
StandardError
- Object
- StandardError
- SpatialFeatures::Unzip::PathNotFound
- Defined in:
- lib/spatial_features/unzip.rb
Overview
EXCEPTIONS
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
The paths the archive did contain, so callers can tell the user what we found instead of only what we needed.
Instance Method Summary collapse
-
#extensions ⇒ Object
Distinct file types in the archive, upcased for display (e.g.
["PDF", "PNG"]). -
#initialize(message = nil, paths = []) ⇒ PathNotFound
constructor
A new instance of PathNotFound.
Constructor Details
#initialize(message = nil, paths = []) ⇒ PathNotFound
Returns a new instance of PathNotFound.
98 99 100 101 |
# File 'lib/spatial_features/unzip.rb', line 98 def initialize( = nil, paths = []) super() @paths = Array(paths) end |
Instance Attribute Details
#paths ⇒ Object (readonly)
The paths the archive did contain, so callers can tell the user what we found instead of only what we needed.
96 97 98 |
# File 'lib/spatial_features/unzip.rb', line 96 def paths @paths end |
Instance Method Details
#extensions ⇒ Object
Distinct file types in the archive, upcased for display (e.g. ["PDF", "PNG"]).
104 105 106 107 108 109 110 |
# File 'lib/spatial_features/unzip.rb', line 104 def extensions paths.reject {|path| path.end_with?('/') } .map {|path| File.extname(path).delete('.').upcase } .reject(&:empty?) .uniq .sort end |