Module: BluePrint::Helper
- Defined in:
- lib/blue_print/helper.rb
Instance Method Summary collapse
Instance Method Details
#within_context_of(name_or_context, fallback = nil, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/blue_print/helper.rb', line 4 def within_context_of(name_or_context, fallback = nil, &block) context = BluePrint::Context.resolve(name_or_context) if context.active? yield BluePrint.env else fallback.respond_to?(:call) && fallback.call end end |