Sha256: 9637c07ef7be8ffde8282b7e84b6975a89a8392eea620f1f2b388de715e8cfc3

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

# Provides a container for boxes that are currently being constructed.
module Manageable
  module Helpers
    class BoxBuilder
      # :nodoc:
      attr_reader :buffers

      # :nodoc:
      def initialize(parent)
        @parent = parent
        @buffers = { :block_header => '', :block_footer => '' }
      end

      # Sets the controls to display in this box. See Activo::Rails::Helper#controls.
      def controls(options = {}, &block)
        buffers[:block_header] << @parent.manageable_controls(options, &block)
        ''
      end

      # Sets the navigation to display on this box. See Activo::Rails::Helper#navigation.
      def navigation(options = {}, &block)
        buffers[:block_header] << @parent.manageable_secondary_navigation(options, &block)
        ''
      end

      # Sets the breadcrumbs to display in this box. See Activo::Rails::Helper#breadcrumbs.
      def breadcrumbs(options = {}, &block)
        buffers[:block_footer] << @parent.manageable_breadcrumbs(options, &block)
        ''
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
manageable-0.1.4 lib/manageable/helpers/box_builder.rb
manageable-0.1.3 lib/manageable/helpers/box_builder.rb
manageable-0.1.2 lib/manageable/helpers/box_builder.rb
manageable-0.1.1 lib/manageable/helpers/box_builder.rb