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
activeadmin-rails-1.7.1 lib/active_admin/page_presenter.rb
activeadmin-rails-1.7.0 lib/active_admin/page_presenter.rb
activeadmin-rb-1.6.0 lib/active_admin/page_presenter.rb
activeadmin-rb-1.5.2 lib/active_admin/page_presenter.rb
activeadmin-rb-1.5.1 lib/active_admin/page_presenter.rb
activeadmin-2.1.0 lib/active_admin/page_presenter.rb
activeadmin-2.0.0 lib/active_admin/page_presenter.rb
activeadmin-rb-1.5.0 lib/active_admin/page_presenter.rb
activeadmin-2.0.0.rc2 lib/active_admin/page_presenter.rb
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_presenter.rb
activeadmin-2.0.0.rc1 lib/active_admin/page_presenter.rb
activeadmin-rb-1.4.0 lib/active_admin/page_presenter.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_presenter.rb
activeadmin-1.4.3 lib/active_admin/page_presenter.rb
activeadmin-1.4.2 lib/active_admin/page_presenter.rb
activeadmin-1.4.1 lib/active_admin/page_presenter.rb
activeadmin-1.4.0 lib/active_admin/page_presenter.rb
activeadmin-1.3.1 lib/active_admin/page_presenter.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_presenter.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/page_presenter.rb