Class: Scrivito::AttributeDefinitionCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
app/cms/scrivito/attribute_definition_collection.rb

Overview

This class represents a collection of attribute definitions.

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Scrivito::AttributeDefinition?

Find definition of an attribute.

Parameters:

  • name (Symbol, String)

    the name of the attribute.

Returns:



35
36
37
# File 'app/cms/scrivito/attribute_definition_collection.rb', line 35

def [](name)
  attribute_definitions[name.to_s]
end

#each {|attribute_definition| ... } ⇒ Object

Iterates over the attribute definitions.

Yield Parameters:

  • attribute_definition (Scrivito:AttributeDefinition)


24
25
26
# File 'app/cms/scrivito/attribute_definition_collection.rb', line 24

def each(&block)
  attribute_definitions.values.each(&block)
end