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
lalala-4.0.0.dev.74 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.73 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.72 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.71 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.66 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.65 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
activeadmin-0.6.0 lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.64 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.63 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.62 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.61 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.60 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.59 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.58 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.57 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.56 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.50 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
lalala-4.0.0.dev.46 vendor/deps/active_admin/lib/active_admin/page_presenter.rb
activeadmin-0.5.1 lib/active_admin/page_presenter.rb