Sha256: b2334cf5489777bf676668d3103498e59b3c689409a99ed73ee36fc59999d9c6

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

module ContextExposer
  module Macros
    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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
context_exposer-0.4.1 lib/context_exposer/macros.rb
context_exposer-0.4.0 lib/context_exposer/macros.rb
context_exposer-0.3.0 lib/context_exposer/macros.rb