Sha256: 8ff2f10939580b9749bd7930d6d50bd0834f51570c2e5ffaf79c9e75695a781e
Contents?: true
Size: 705 Bytes
Versions: 33
Compression:
Stored size: 705 Bytes
Contents
# frozen_string_literal: true 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 = options @block = block end def [](key) @options[key] end end end
Version data entries
33 entries across 33 versions & 1 rubygems