Module: Olelo::Attributes::ClassMethods

Defined in:
lib/olelo/attributes.rb

Overview

Extends class with attribute editor DSL

Instance Method Summary collapse

Instance Method Details

#attribute_groupAttributeGroup

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Root attribute group

Returns:



238
239
240
# File 'lib/olelo/attributes.rb', line 238

def attribute_group
  @attribute_group ||= AttributeGroup.new
end

#attributes { ... } ⇒ void

This method returns an undefined value.

Add attribute to the attribute editor

Examples:

add string attribute title

attributes do
  string :title
end

add group with multiple attributes

attributes do
  group :acl do
    list :read
    list :write
  end

Yields:

  • DSL block



260
261
262
# File 'lib/olelo/attributes.rb', line 260

def attributes(&block)
  AttributeDSL.new(attribute_group, &block)
end