Class: Bundler::Thor::NestedContext
- Inherits:
-
Object
- Object
- Bundler::Thor::NestedContext
- Defined in:
- lib/bundler/vendor/thor/lib/thor/nested_context.rb
Instance Method Summary collapse
- #enter ⇒ Object
- #entered? ⇒ Boolean
-
#initialize ⇒ NestedContext
constructor
A new instance of NestedContext.
Constructor Details
#initialize ⇒ NestedContext
Returns a new instance of NestedContext.
3 4 5 |
# File 'lib/bundler/vendor/thor/lib/thor/nested_context.rb', line 3 def initialize @depth = 0 end |
Instance Method Details
#enter ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/bundler/vendor/thor/lib/thor/nested_context.rb', line 7 def enter push yield ensure pop end |
#entered? ⇒ Boolean
15 16 17 |
# File 'lib/bundler/vendor/thor/lib/thor/nested_context.rb', line 15 def entered? @depth.positive? end |