Sha256: ef6dcd5078246392275590865f857e42b06b63fc8992c0d9bc07fe118b1769f3

Contents?: true

Size: 520 Bytes

Versions: 8

Compression:

Stored size: 520 Bytes

Contents

module CmAdmin
  module Models
    class CmShowSection

      attr_accessor :section_name, :available_section_fields, :display_if

      def initialize(section_name, display_if, &block)
        @available_section_fields = []
        @section_name = section_name
        @display_if = display_if || lambda { |arg| return true }
        instance_eval(&block)
      end

      def field(field_name, options={})
        @available_section_fields << CmAdmin::Models::Field.new(field_name, options)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cm-admin-1.0.2 lib/cm_admin/models/cm_show_section.rb
cm-admin-1.0.0 lib/cm_admin/models/cm_show_section.rb
cm-admin-0.9.1 lib/cm_admin/models/cm_show_section.rb
cm-admin-0.9.0 lib/cm_admin/models/cm_show_section.rb
cm-admin-0.8.9 lib/cm_admin/models/cm_show_section.rb
cm-admin-0.8.8 lib/cm_admin/models/cm_show_section.rb
cm-admin-0.8.7 lib/cm_admin/models/cm_show_section.rb
cm-admin-0.8.6 lib/cm_admin/models/cm_show_section.rb