Class: ChupaText::PathConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/chupa-text/path-converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ PathConverter

Returns a new instance of PathConverter.



21
22
23
24
# File 'lib/chupa-text/path-converter.rb', line 21

def initialize(path, options={})
  @path = path
  @options = options
end

Instance Method Details

#convertObject



26
27
28
29
30
31
32
# File 'lib/chupa-text/path-converter.rb', line 26

def convert
  path = @path
  encoding = @options[:encoding]
  path = convert_encoding(path, encoding) if encoding
  path = convert_to_uri_path(path) if @options[:uri_escape]
  path
end