Class: Graphlyte::Editors::InferSignature
- Inherits:
-
WithVariables
- Object
- WithVariables
- Graphlyte::Editors::InferSignature
- Defined in:
- lib/graphlyte/editors/infer_signature.rb
Overview
Subclass of the full variable inference editor that runs solely on static information (no knowledge of variable runtime values or the exact selected operation).
The main difference is that we are more lenient about raising.
Constant Summary
Constants inherited from WithVariables
WithVariables::CannotInfer, WithVariables::TypeMismatch
Instance Method Summary collapse
-
#cannot_infer!(ref) ⇒ Object
We should always be able to infer if there is a schema But if we are in dynamic mode, defer inferrence errors until we have runtime values (see ‘WithVariables`).
-
#initialize(schema = nil) ⇒ InferSignature
constructor
A new instance of InferSignature.
- #runtime_type_of(_ref) ⇒ Object
- #select_operation(_doc) ⇒ Object
Methods inherited from WithVariables
#annotate_types, #current_operation_variables, #edit, #infer, #infer_operation, #infer_variable_type
Constructor Details
#initialize(schema = nil) ⇒ InferSignature
Returns a new instance of InferSignature.
16 17 18 |
# File 'lib/graphlyte/editors/infer_signature.rb', line 16 def initialize(schema = nil) super(schema, nil, nil) end |
Instance Method Details
#cannot_infer!(ref) ⇒ Object
We should always be able to infer if there is a schema But if we are in dynamic mode, defer inferrence errors until we have runtime values (see ‘WithVariables`)
27 28 29 |
# File 'lib/graphlyte/editors/infer_signature.rb', line 27 def cannot_infer!(ref) super if @schema end |
#runtime_type_of(_ref) ⇒ Object
31 32 33 |
# File 'lib/graphlyte/editors/infer_signature.rb', line 31 def runtime_type_of(_ref) # no-op end |
#select_operation(_doc) ⇒ Object
20 21 22 |
# File 'lib/graphlyte/editors/infer_signature.rb', line 20 def select_operation(_doc) # no-op end |