Class: EacRubyUtils::Context
Instance Method Summary collapse
Instance Method Details
#current ⇒ Object
7 8 9 |
# File 'lib/eac_ruby_utils/context.rb', line 7 def current optional_current || raise('No elements in context') end |
#on(obj) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/eac_ruby_utils/context.rb', line 18 def on(obj) push(obj) begin yield ensure pop end end |
#optional_current ⇒ Object
11 12 13 |
# File 'lib/eac_ruby_utils/context.rb', line 11 def optional_current stack.last end |