Class: Monolens::Lens::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/monolens/lens/location.rb

Instance Method Summary collapse

Constructor Details

#initialize(parts = []) ⇒ Location

Returns a new instance of Location.



4
5
6
# File 'lib/monolens/lens/location.rb', line 4

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

Instance Method Details

#deeper(part) {|Location.new(@parts + [part])| ... } ⇒ Object

Yields:



8
9
10
# File 'lib/monolens/lens/location.rb', line 8

def deeper(part)
  yield Location.new(@parts + [part])
end

#to_aObject



12
13
14
# File 'lib/monolens/lens/location.rb', line 12

def to_a
  @parts.dup
end