Exception: SpatialFeatures::Unzip::PathNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/spatial_features/unzip.rb

Overview

EXCEPTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

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(message = nil, paths = [])
  super(message)
  @paths = Array(paths)
end

Instance Attribute Details

#pathsObject (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

#extensionsObject

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