Class: Avm::PathString
- Inherits:
-
String
- Object
- String
- Avm::PathString
- 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
-
.paths(string) ⇒ Object
Shortcut for [Avm::Paths.new(string).paths].
Instance Method Summary collapse
-
#initialize(string = nil) ⇒ PathString
constructor
A new instance of PathString.
-
#paths ⇒ Array
List of paths.
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
#paths ⇒ Array
Returns List of paths. Blank paths are rejected.
23 24 25 |
# File 'lib/avm/path_string.rb', line 23 def paths split(SEPARATOR).compact_blank end |