Class: Autocad::Paths
- Inherits:
-
Object
- Object
- Autocad::Paths
- Includes:
- Enumerable
- Defined in:
- lib/autocad/paths.rb
Instance Method Summary collapse
- #<<(path) ⇒ Object
- #append(path) ⇒ Object
- #each ⇒ Object
-
#initialize(path) ⇒ Paths
constructor
A new instance of Paths.
- #prepend(path) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path) ⇒ Paths
Returns a new instance of Paths.
5 6 7 |
# File 'lib/autocad/paths.rb', line 5 def initialize(path) @paths = path.split(";").map { |p| Pathname(p) } end |
Instance Method Details
#<<(path) ⇒ Object
9 10 11 |
# File 'lib/autocad/paths.rb', line 9 def <<(path) @paths << Path(path) end |
#append(path) ⇒ Object
13 14 15 |
# File 'lib/autocad/paths.rb', line 13 def append(path) @paths.append Path(path) end |
#each ⇒ Object
21 22 23 |
# File 'lib/autocad/paths.rb', line 21 def each(...) paths.each(...) end |
#prepend(path) ⇒ Object
17 18 19 |
# File 'lib/autocad/paths.rb', line 17 def prepend(path) paths.prepend Path(path) end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/autocad/paths.rb', line 25 def to_s parhs.join(";") end |