lib/surrealist/schema_definer.rb
# Defines an instance variable on the object that stores the schema.
#
# @param [Object] klass class of the object that needs to be surrealized.
#
# @param [Hash] hash the schema defined in the object's class.
#
# @return [Hash] +@__surrealist_schema+ variable that stores the schema of the object.
#
# @raise +Surrealist::InvalidSchemaError+ if schema was defined not through a hash.
Defines an instance variable on the object that stores the schema.
Defines an instance variable on the object that stores the schema .
def call(klass, hash)
        raise Surrealist::InvalidSchemaError, SCHEMA_TYPE_ERROR unless hash.is_a?(Hash)
        Surrealist::VarsHelper.set_schema(klass, hash)
      end
def call ( klass , hash ) raise Surrealist :: InvalidSchemaError , SCHEMA_TYPE_ERROR unless hash . is_a? ( Hash ) Surrealist :: VarsHelper . set_schema ( klass , hash ) end
Defines an instance variable on the object that stores the schema.
Defines an instance variable on the object that stores the schema .
+@__surrealist_schema+ variable that stores the schema of the object.
+ @__surrealist_schema + variable that stores the schema of the object .
Hash
+Surrealist::InvalidSchemaError+ if schema was defined not through a hash.
+ Surrealist :: InvalidSchemaError + if schema was defined not through a hash .
klass
<not_specific>
hash
<not_specific>
<not_specific>
hash the schema defined in the object's class.
hash the schema defined in the object ' s class .