Module: ContextExposer::Macros

Defined in:
lib/context_exposer/macros.rb

Instance Method Summary collapse

Instance Method Details

#context_exposer(name = :base, options = {}) ⇒ Object



3
4
5
6
7
# File 'lib/context_exposer/macros.rb', line 3

def context_exposer name = :base, options = {}
  self.send :include, "ContextExposer::#{name.to_s.camelize}Controller".constantize
  
  integrates_with [options[:with]].flatten if options[:with]
end

#decorates_before_renderingObject Also known as: decorates_before_render



9
10
11
12
13
14
# File 'lib/context_exposer/macros.rb', line 9

def decorates_before_rendering
  unless defined? ::DecoratesBeforeRendering
    raise "DecoratesBeforeRendering not found, please include the gem 'decorates_before_rendering'"
  end
  self.send :include, DecoratesBeforeRendering
end