Class: RVC::Location
- Inherits:
-
Object
- Object
- RVC::Location
- Defined in:
- lib/rvc/fs.rb
Instance Attribute Summary collapse
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Instance Method Summary collapse
-
#initialize(root) ⇒ Location
constructor
A new instance of Location.
- #initialize_copy(src) ⇒ Object
- #obj ⇒ Object
- #path ⇒ Object
- #pop ⇒ Object
- #push(name, obj) ⇒ Object
Constructor Details
Instance Attribute Details
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
24 25 26 |
# File 'lib/rvc/fs.rb', line 24 def stack @stack end |
Instance Method Details
#initialize_copy(src) ⇒ Object
30 31 32 33 |
# File 'lib/rvc/fs.rb', line 30 def initialize_copy src super @stack = @stack.dup end |
#obj ⇒ Object
43 44 45 |
# File 'lib/rvc/fs.rb', line 43 def obj @stack.empty? ? nil : @stack[-1][1] end |
#path ⇒ Object
47 48 49 |
# File 'lib/rvc/fs.rb', line 47 def path @stack.map { |name,obj| name } end |
#pop ⇒ Object
39 40 41 |
# File 'lib/rvc/fs.rb', line 39 def pop @stack.pop end |
#push(name, obj) ⇒ Object
35 36 37 |
# File 'lib/rvc/fs.rb', line 35 def push name, obj @stack << [name, obj] end |