Class: Avm::PathString

Inherits:
String
  • Object
show all
Defined in:
lib/avm/path_string.rb

Overview

String with paths like PATH variable. Note: the separator is not system dependent.

Constant Summary collapse

SEPARATOR =
':'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string = nil) ⇒ PathString

Returns a new instance of PathString.



18
19
20
# File 'lib/avm/path_string.rb', line 18

def initialize(string = nil)
  super(string.to_s)
end

Class Method Details

.paths(string) ⇒ Object

Shortcut for [Avm::Paths.new(string).paths].



13
14
15
# File 'lib/avm/path_string.rb', line 13

def paths(string)
  new(string).paths
end

Instance Method Details

#pathsArray

Returns List of paths. Blank paths are rejected.

Returns:

  • (Array)

    List of paths. Blank paths are rejected.



23
24
25
# File 'lib/avm/path_string.rb', line 23

def paths
  split(SEPARATOR).reject(&:blank?)
end