lib/surrealist/class_methods.rb
# A DSL method to return the defined schema.
# @example DSL usage example
#   class Person
#     include Surrealist
#
#     json_schema do
#       { name: String }
#     end
#
#     def name
#       'Parent'
#     end
#   end
#
#   Person.defined_schema
#   # => { name: String }
A DSL method to return the defined schema.
A DSL method to return the defined schema .
def defined_schema
      read_schema.tap do |schema|
        raise UnknownSchemaError if schema.nil?
      end
    end
def defined_schema read_schema . tap do | schema | raise UnknownSchemaError if schema . nil? end end
A DSL method to return the defined schema.
A DSL method to return the defined schema .
example
DSL usage example class Person include Surrealist json_schema do { name: String } end def name 'Parent' end end Person.defined_schema # => { name: String }
DSL usage example class Person include Surrealist json_schema do { name : String } end def name ' Parent ' end end Person . defined_schema # = > { name : String }