Class: JSI::SchemaModule
- Inherits:
-
Module
- Object
- Module
- JSI::SchemaModule
- Includes:
- Connects
- Defined in:
- lib/jsi/schema_classes.rb,
lib/jsi/schema_classes.rb
Overview
A Module associated with a JSI Schema. See JSI::Schema#jsi_schema_module.
Defined Under Namespace
Modules: Connects, DescribesSchemaModule Classes: Connection
Instance Attribute Summary
Attributes included from Connects
Instance Method Summary collapse
- #inspect ⇒ String (also: #to_s)
- #instance_valid?(instance) ⇒ Boolean
- #instance_validate(instance) ⇒ Object
-
#new_jsi(instance, **kw) ⇒ JSI::Base subclass
invokes JSI::Schema#new_jsi on this module's schema, passing the given instance.
-
#schema ⇒ Base + Schema
The schema for which this is the JSI Schema Module.
- #schema_content ⇒ Object
-
#schema_uri ⇒ Addressable::URI?
a URI which refers to the schema.
Methods included from Connects
Instance Method Details
#inspect ⇒ String Also known as: to_s
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/jsi/schema_classes.rb', line 30 def inspect if name_from_ancestor if schema.schema_absolute_uri -"#{name_from_ancestor} <#{schema.schema_absolute_uri}> (JSI Schema Module)" else -"#{name_from_ancestor} (JSI Schema Module)" end else -"(JSI Schema Module: #{schema.schema_uri || schema.jsi_ptr.uri})" end end |
#instance_valid?(instance) ⇒ Boolean
64 65 66 |
# File 'lib/jsi/schema_classes.rb', line 64 def instance_valid?(instance) schema.instance_valid?(instance) end |
#instance_validate(instance) ⇒ Object
59 60 61 |
# File 'lib/jsi/schema_classes.rb', line 59 def instance_validate(instance) schema.instance_validate(instance) end |
#new_jsi(instance, **kw) ⇒ JSI::Base subclass
invokes JSI::Schema#new_jsi on this module's schema, passing the given instance.
49 50 51 |
# File 'lib/jsi/schema_classes.rb', line 49 def new_jsi(instance, **kw) schema.new_jsi(instance, **kw) end |
#schema ⇒ Base + Schema
The schema for which this is the JSI Schema Module
19 20 21 |
# File 'lib/jsi/schema_classes.rb', line 19 def schema @jsi_node end |
#schema_content ⇒ Object
54 55 56 |
# File 'lib/jsi/schema_classes.rb', line 54 def schema_content schema.jsi_node_content end |
#schema_uri ⇒ Addressable::URI?
a URI which refers to the schema. see JSI::Schema#schema_uri.
25 26 27 |
# File 'lib/jsi/schema_classes.rb', line 25 def schema_uri schema.schema_uri end |