Module: Serega::SeregaPlugins::Metadata::ClassMethods

Defined in:
lib/serega/plugins/metadata/metadata.rb

Overview

Serega class additional/patched class methods

Instance Method Summary collapse

Instance Method Details

#meta_attribute(*path, **opts, &block) ⇒ Serega::SeregaPlugins::Metadata::MetaAttribute

Define metadata attribute

Parameters:

  • path (String, Symbol)

    Metadata attribute path keys

  • opts (Hash)

    Metadata attribute options

  • block (Proc)

    Block to fetch metadata attribute value

Returns:



164
165
166
167
# File 'lib/serega/plugins/metadata/metadata.rb', line 164

def meta_attribute(*path, **opts, &block)
  attribute = self::MetaAttribute.new(path: path, opts: opts, block: block)
  meta_attributes[attribute.name] = attribute
end

#meta_attributesHash<Symbol => Serega::SeregaPlugins::Metadata::MetaAttribute>

List of added metadata attributes

Returns:



151
152
153
# File 'lib/serega/plugins/metadata/metadata.rb', line 151

def meta_attributes
  @meta_attributes ||= {}
end