Sha256: 2826104419e08b1e567b0aacc89c9839e9617c340f940defc26a26c0f3565e46

Contents?: true

Size: 611 Bytes

Versions: 9

Compression:

Stored size: 611 Bytes

Contents

module Enjoy
  module Admin
    module Menu
      def self.config(fields = {})
        Proc.new {
          # navigation_label 'CMS'

          field :enabled, :toggle
          field :text_slug
          field :name

          fields.each_pair do |name, type|
            if type.nil?
              field name
            else
              if type.is_a?(Array)
                field name, type[0], &type[1]
              else
                field name, type
              end
            end
          end

          if block_given?
            yield self
          end
        }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
enjoy_cms-0.3.2.1 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.2 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.1.2 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.1.1 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.1 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.0.4 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.0.3 lib/enjoy/admin/menu.rb
enjoy_cms-0.3.0.2 lib/enjoy/admin/menu.rb
enjoy_cms-0.2.1 lib/enjoy/admin/menu.rb