Module: Canned::Context::Matchers::Load
Instance Method Summary collapse
-
#loaded(_name, _options = {}, &_block) ⇒ Object
(also: #loads)
Loads a resource and returns a resource context.
Instance Method Details
#loaded(_name, _options = {}, &_block) ⇒ Object Also known as: loads
Loads a resource and returns a resource context.
of that returned by this function.
14 15 16 17 18 19 20 |
# File 'lib/canned/context/matchers/load.rb', line 14 def loaded(_name, ={}, &_block) _chain_context(Canned::Context::Resource, _block) do |stack| res = @ctx.resources[_name] next false if res.nil? stack.push(:resource, .fetch(:as, _name), res) end end |