Exception: Udb::TopLevelDatabaseObject::SchemaError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/udb/obj/database_obj.rb

Overview

Exception raised when there is a problem with a schema file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ SchemaError

Returns a new instance of SchemaError.



309
310
311
312
313
314
315
316
# File 'lib/udb/obj/database_obj.rb', line 309

def initialize(result)
  if result.is_a?(Enumerator)
    super(result.to_a.map { |e| "At #{e['schema_pointer']}: #{e['type']}" })
  else
    super(result["error"])
  end
  @result = result
end

Instance Attribute Details

#resultObject (readonly)

result from JsonSchemer.validate



307
308
309
# File 'lib/udb/obj/database_obj.rb', line 307

def result
  @result
end