Class: Autocad::Paths

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/autocad/paths.rb

Instance Method Summary collapse

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

#eachObject



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_sObject



25
26
27
# File 'lib/autocad/paths.rb', line 25

def to_s
  parhs.join(";")
end