Exception: Darkroom::InvalidPathError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/darkroom/errors/invalid_path_error.rb

Overview

Error class used when an asset’s path contains one or more invalid characters.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, index) ⇒ InvalidPathError

Public: Create a new instance.

path - Path of the asset with the invalid character(s). index - Position of the first bad character in the path.



14
15
16
17
18
19
# File 'lib/darkroom/errors/invalid_path_error.rb', line 14

def initialize(path, index)
  super("Asset path contains one or more invalid characters (#{Asset::DISALLOWED_PATH_CHARS}): #{path}")

  @path = path
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



8
9
10
# File 'lib/darkroom/errors/invalid_path_error.rb', line 8

def index
  @index
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/darkroom/errors/invalid_path_error.rb', line 8

def path
  @path
end