Sha256: dc3827b0e3fbc77046e1fa2d7ef5fd597ca37535fe63216c2433d15bab0df9d2

Contents?: true

Size: 667 Bytes

Versions: 59

Compression:

Stored size: 667 Bytes

Contents

module ActiveAdmin

  # A simple object that gets used to present different aspects of views
  #
  # Initialize with a set of options and a block. The options become
  # available using hash style syntax.
  #
  # Usage:
  #
  #     presenter = PagePresenter.new :as => :table do
  #       # some awesome stuff
  #     end
  #
  #     presenter[:as]    #=> :table
  #     presenter.block   #=> The block passed in to new
  #
  class PagePresenter

    attr_reader :block, :options

    delegate :has_key?, :to => :options

    def initialize(options = {}, &block)
      @options, @block = options, block
    end

    def [](key)
      @options[key]
    end

  end
end

Version data entries

59 entries across 59 versions & 4 rubygems

Version Path
activeadmin-0.6.6 lib/active_admin/page_presenter.rb
activeadmin-0.6.5 lib/active_admin/page_presenter.rb
activeadmin-0.6.4 lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.4.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.3.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.2.pre lib/active_admin/page_presenter.rb
activeadmin-0.6.3 lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.1.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.0.pre lib/active_admin/page_presenter.rb
activeadmin-0.6.2 lib/active_admin/page_presenter.rb
activeadmin-0.6.1 lib/active_admin/page_presenter.rb
aa-rails4-0.6.0 lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.141 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/lib/active_admin/page_presenter.rb