Module: ActiveFedora::WithMetadata::ClassMethods
- Defined in:
- lib/active_fedora/with_metadata.rb
Instance Method Summary collapse
- #metadata(&block) ⇒ Object
- #metadata_schema ⇒ Object
-
#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.
Instance Method Details
#metadata(&block) ⇒ Object
19 20 21 |
# File 'lib/active_fedora/with_metadata.rb', line 19 def (&block) .exec_block(&block) end |
#metadata_schema ⇒ Object
23 24 25 |
# File 'lib/active_fedora/with_metadata.rb', line 23 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.
29 30 31 32 33 |
# File 'lib/active_fedora/with_metadata.rb', line 29 def MetadataNode(parent_klass) klass = const_set(:GeneratedMetadataSchema, Class.new(MetadataNode)) klass.parent_class = parent_klass klass end |