Module: IMW::Metadata::Schematized

Included in:
Resource
Defined in:
lib/imw/metadata/schematized.rb

Instance Method Summary collapse

Instance Method Details

#schemaIMW::Metadata::Schema?

The schema for this object.

Returns:



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.

Parameters:

Returns:



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