Sha256: 8c84bff6b637929e0ba0ad1ad1c833ceb7c9c0e2eecc983034cc52f1bae5f097

Contents?: true

Size: 686 Bytes

Versions: 17

Compression:

Stored size: 686 Bytes

Contents

module PufferPages
  module Extensions
    module Mapper

      def self.included base
        base.class_eval do
          class_attribute :_puffer_pages
          include InstanceMethods
        end
      end

      module InstanceMethods

        def puffer_pages_options
          self.class._puffer_pages.presence || [{'(*path)' => 'pages#index', :as => 'puffer_page'}]
        end

        def puffer_pages *args
          options = args.extract_options!
          options.merge! :as => 'puffer_page'
          self.class._puffer_pages = args.push(options)
        end

      end

    end

  end
end

ActionDispatch::Routing::Mapper.send :include, PufferPages::Extensions::Mapper

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
puffer_pages-0.0.19 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.18 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.17 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.16 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.15 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.14 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.13 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.12 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.11 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.10 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.9 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.8 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.7 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.6 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.5 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.4 lib/puffer_pages/extensions/mapper.rb
puffer_pages-0.0.3 lib/puffer_pages/extensions/mapper.rb