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:



357
358
359
360
361
362
363
364
# File 'lib/mosquito.rb', line 357

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