Sha256: 3e44baef5a35551d7a04c7d0091c3d58ba18867b143630e054b7c4dab552cc93

Contents?: true

Size: 669 Bytes

Versions: 54

Compression:

Stored size: 669 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?, :fetch, to: :options

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

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

  end
end

Version data entries

54 entries across 54 versions & 6 rubygems

Version Path
yousty-activeadmin-1.0.14.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.13.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.12.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.11.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.10.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.9.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.8.pre lib/active_admin/page_presenter.rb
activeadmin-1.0.0.pre4 lib/active_admin/page_presenter.rb
activeadmin-1.0.0.pre3 lib/active_admin/page_presenter.rb
activeadmin-1.0.0.pre2 lib/active_admin/page_presenter.rb
activeadmin-1.0.0.pre1 lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.7.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.6.pre lib/active_admin/page_presenter.rb
yousty-activeadmin-1.0.5.pre lib/active_admin/page_presenter.rb