Module: JSI::SchemaModule

Defined in:
lib/jsi/schema_classes.rb

Overview

JSI Schema Modules are extended with JSI::SchemaModule

Instance Method Summary collapse

Instance Method Details

#inspectString

Returns:

  • (String)


13
14
15
16
17
18
19
20
# File 'lib/jsi/schema_classes.rb', line 13

def inspect
  uri = schema.schema_id || schema.node_ptr.uri
  if name
    "#{name} (#{uri})"
  else
    "(JSI Schema Module: #{uri})"
  end
end

#new_jsi(instance, *a, &b) ⇒ JSI::Base

invokes JSI::Schema#new_jsi on this module's schema, passing the given instance.

Returns:

  • (JSI::Base)

    a JSI whose instance is the given instance



24
25
26
# File 'lib/jsi/schema_classes.rb', line 24

def new_jsi(instance, *a, &b)
  schema.new_jsi(instance, *a, &b)
end

#schema_idString

Returns absolute schema_id of the schema this module represents. see JSI::Schema#schema_id.

Returns:



8
9
10
# File 'lib/jsi/schema_classes.rb', line 8

def schema_id
  schema.schema_id
end