Module: Surrealist::SchemaDefiner
- Defined in:
- lib/surrealist/schema_definer.rb
Overview
A class that defines a method on the object that stores the schema.
Constant Summary collapse
- SCHEMA_TYPE_ERROR =
'Schema should be defined as a hash'
Class Method Summary collapse
-
.call(klass, hash) ⇒ Hash
Defines an instance variable on the object that stores the schema.
Class Method Details
.call(klass, hash) ⇒ Hash
Defines an instance variable on the object that stores the schema.
18 19 20 21 22 |
# File 'lib/surrealist/schema_definer.rb', line 18 def call(klass, hash) raise Surrealist::InvalidSchemaError, SCHEMA_TYPE_ERROR unless hash.is_a?(Hash) Surrealist::VarsHelper.set_schema(klass, hash) end |