Module: PufferPages::Helpers

Defined in:
lib/puffer_pages/helpers.rb

Instance Method Summary collapse

Instance Method Details

#puffer_pages_contextObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/puffer_pages/helpers.rb', line 3

def puffer_pages_context
  drops = assigns.each_with_object({}) do |(key, value), result|
    result[key] = value if value.respond_to?(:to_liquid)
  end
  registers = assigns.each_with_object({}) do |(key, value), result|
    result[key] = value
  end

  { drops: drops, registers: registers.merge!(:controller => controller) }
end