Module: Mosquito::Proboscis

Defined in:
lib/mosquito.rb

Overview

Stealing our assigns the evil way. This should pose no problem for things that happen in the controller actions, but might be tricky if some other service upstream munges the variables. This service will always get included last (innermost), so it runs regardless of the services upstream (such as HTTP auth) that might not call super

Instance Method Summary collapse

Instance Method Details

#service(*a) ⇒ Object

:nodoc:



363
364
365
366
367
368
369
370
# File 'lib/mosquito.rb', line 363

def service(*a)
  returning(super(*a)) do
    a = instance_variables.inject({}) do | assigns, ivar |
      assigns[ivar.gsub(/^@/, '')] = instance_variable_get(ivar); assigns
    end
    Mosquito.stash(::Camping::H[a])
  end
end