Module: JSI::Schema::OldId

Included in:
Draft04
Defined in:
lib/jsi/schema.rb

Overview

extends any schema which uses the keyword 'id' to identify its canonical URI

Instance Method Summary collapse

Instance Method Details

#id#to_str?

the contents of an id keyword whose value is a string, or nil

Returns:

  • (#to_str, nil)


49
50
51
52
53
54
55
# File 'lib/jsi/schema.rb', line 49

def id
  if keyword?('id') && schema_content['id'].respond_to?(:to_str)
    schema_content['id']
  else
    nil
  end
end