Module: IMW::Metadata::Schematized
- Included in:
- Resource
- Defined in:
- lib/imw/metadata/schematized.rb
Instance Method Summary collapse
-
#schema ⇒ IMW::Metadata::Schema?
The schema for this object.
-
#schema=(new_schema) ⇒ IMW::Metadata::Schema
Set a new schema for this object.
Instance Method Details
#schema ⇒ IMW::Metadata::Schema?
The schema for this object.
8 9 10 |
# File 'lib/imw/metadata/schematized.rb', line 8 def schema @schema end |
#schema=(new_schema) ⇒ IMW::Metadata::Schema
Set a new schema for this object.
Will call the object’s validate_schema!
hook which should check the record and take the appropriate action if it’s invalid.
20 21 22 23 24 |
# File 'lib/imw/metadata/schematized.rb', line 20 def schema= new_schema @schema = IMW::Metadata::Schema.new(new_schema) validate_schema! if respond_to?(:validate_schema!) @schema end |