Class: Configurations::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/configurations/path.rb

Instance Method Summary collapse

Constructor Details

#initialize(path = []) ⇒ Path

Returns a new instance of Path.


3
4
5
# File 'lib/configurations/path.rb', line 3

def initialize(path = [])
  @path = path
end

Instance Method Details

#add(*path) ⇒ Object


7
8
9
# File 'lib/configurations/path.rb', line 7

def add(*path)
  Path.new(@path + path)
end

#reduce(initial, &block) ⇒ Object


11
12
13
# File 'lib/configurations/path.rb', line 11

def reduce(initial, &block)
  @path.reduce(initial, &block)
end

#to_sObject Also known as: inspect, print


15
16
17
# File 'lib/configurations/path.rb', line 15

def to_s
  @path.join(".")
end