module Olelo::Attributes::ClassMethods

Extends class with attribute editor DSL

Public Instance Methods

attribute_group() click to toggle source

Root attribute group

@return [AttributeGroup] Root editor group @api private

# File lib/olelo/attributes.rb, line 238
def attribute_group
  @attribute_group ||= AttributeGroup.new
end
attributes(&block) click to toggle source

Add attribute to the attribute editor

@yield DSL block @return [void] @api public

@example add string attribute title

attributes do
  string :title
end

@example add group with multiple attributes

attributes do
  group :acl do
    list :read
    list :write
  end
# File lib/olelo/attributes.rb, line 260
def attributes(&block)
  AttributeDSL.new(attribute_group, &block)
end