Module: ActiveFedora::WithMetadata::ClassMethods

Defined in:
lib/active_fedora/with_metadata.rb

Instance Method Summary collapse

Instance Method Details

#metadata(&block) ⇒ Object


20
21
22
# File 'lib/active_fedora/with_metadata.rb', line 20

def (&block)
  .exec_block(&block)
end

#metadata_schemaObject


24
25
26
# File 'lib/active_fedora/with_metadata.rb', line 24

def 
  @metadata_schema ||= MetadataNode(self)
end

#MetadataNode(parent_klass) ⇒ Object

Make a subclass of MetadataNode named GeneratedMetadataSchema and set its parent_class attribute to have the value of the current class.


30
31
32
33
34
# File 'lib/active_fedora/with_metadata.rb', line 30

def MetadataNode(parent_klass)
  klass = self.const_set(:GeneratedMetadataSchema, Class.new(MetadataNode))
  klass.parent_class = parent_klass
  klass
end