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
 - #to_s ⇒ Object
 
Methods included from Connects
Constructor Details
#initialize(node) ⇒ Connection
Returns a new instance of Connection.
      345 346 347 348 349 350 351 352  | 
    
      # File 'lib/jsi/schema_classes.rb', line 345 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
      355 356 357 358 359 360 361  | 
    
      # File 'lib/jsi/schema_classes.rb', line 355 def inspect if name_from_ancestor -"#{name_from_ancestor} (#{self.class})" else -"(#{self.class}: #{@jsi_node.jsi_ptr.uri})" end end  | 
  
#to_s ⇒ Object
      363 364 365  | 
    
      # File 'lib/jsi/schema_classes.rb', line 363 def to_s inspect end  |