Method: JSI::Schema::IdWithAnchor#anchor

Defined in:
lib/jsi/schema.rb

#anchorString

an anchor defined by a non-empty fragment in the id uri

Returns:

  • (String)


100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/jsi/schema.rb', line 100

def anchor
  if id
    id_uri = Util.uri(id)
    if id_uri.fragment == ''
      nil
    else
      id_uri.fragment
    end
  else
    nil
  end
end