Sha256: c5df7ba6abb28fab888ffa6426985aec8dde253463d8e0fa2ad66cddf23da92e
Contents?: true
Size: 893 Bytes
Versions: 118
Compression:
Stored size: 893 Bytes
Contents
module Scrivito # # This class represents a collection of attribute definitions. # # @api public # class AttributeDefinitionCollection include Enumerable # Compatibility for Object#blank? delegate :empty?, to: :attribute_definitions def initialize(attribute_definitions) @attribute_definitions = attribute_definitions end # # Iterates over the attribute definitions. # # @api public # @yieldparam [Scrivito:AttributeDefinition] attribute_definition # def each(&block) attribute_definitions.values.each(&block) end # # Find definition of an attribute. # # @api public # @param name [Symbol, String] the name of the attribute. # @return [Scrivito::AttributeDefinition, nil] attribute definition if found or +nil+ otherwise. # def [](name) attribute_definitions[name.to_s] end private attr_reader :attribute_definitions end end
Version data entries
118 entries across 118 versions & 1 rubygems