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.



317
318
319
320
321
322
323
324
# File 'lib/udb/obj/database_obj.rb', line 317

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



315
316
317
# File 'lib/udb/obj/database_obj.rb', line 315

def result
  @result
end