Sha256: bad6d1c0dd3a091915be728e80dbde85649293da90d1214699ef95a848eea9e9

Contents?: true

Size: 626 Bytes

Versions: 12

Compression:

Stored size: 626 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

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

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

  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
activeadmin-0.5.0 lib/active_admin/page_presenter.rb
activeadmin-0.5.0.pre1 lib/active_admin/page_presenter.rb
activeadmin-0.5.0.pre lib/active_admin/page_presenter.rb
activeadmin-0.4.4 lib/active_admin/page_presenter.rb
activeadmin-0.4.3 lib/active_admin/page_presenter.rb
activeadmin-0.4.2 lib/active_admin/page_presenter.rb
activeadmin-0.4.1 lib/active_admin/page_presenter.rb
activeadmin-0.4.0 lib/active_admin/page_presenter.rb
andrewroth_activeadmin-0.3.4.4 lib/active_admin/page_presenter.rb
andrewroth_activeadmin-0.3.4.3 lib/active_admin/page_presenter.rb
andrewroth_activeadmin-0.3.4.2 lib/active_admin/page_presenter.rb
andrewroth_activeadmin-0.3.4.1 lib/active_admin/page_presenter.rb