Class: JSI::SchemaModule::Connection
- Inherits:
-
Object
- Object
- JSI::SchemaModule::Connection
- Includes:
- Connects
- Defined in:
- lib/jsi/schema_classes.rb
Overview
A JSI Schema Module is a module which represents a schema. A SchemaModule::Connection represents a node in a schema's document which is not a schema, such as the 'properties' object (which contains schemas but is not a schema).
instances of this class act as a stand-in to allow users to subscript or call property accessors on schema modules to refer to their subschemas' schema modules.
A SchemaModule::Connection has readers for property names described by the node's schemas.
Instance Attribute Summary
Attributes included from Connects
Instance Method Summary collapse
-
#initialize(node) ⇒ Connection
constructor
A new instance of Connection.
- #inspect ⇒ String (also: #to_s)
Methods included from Connects
Constructor Details
#initialize(node) ⇒ Connection
Returns a new instance of Connection.
337 338 339 340 341 342 343 344 |
# File 'lib/jsi/schema_classes.rb', line 337 def initialize(node) raise(Bug, "node must be JSI::Base: #{node.pretty_inspect.chomp}") unless node.is_a?(JSI::Base) raise(Bug, "node must not be JSI::Schema: #{node.pretty_inspect.chomp}") if node.is_a?(JSI::Schema) @jsi_node = node node.jsi_schemas.each do |schema| extend(JSI::SchemaClasses.schema_property_reader_module(schema, conflicting_modules: [SchemaModule::Connection])) end end |
Instance Method Details
#inspect ⇒ String Also known as: to_s
347 348 349 350 351 352 353 |
# File 'lib/jsi/schema_classes.rb', line 347 def inspect if name_from_ancestor -"#{name_from_ancestor} (#{self.class})" else -"(#{self.class}: #{@jsi_node.jsi_ptr.uri})" end end |