Module: Yoda::Typing::Contexts::ContextDerivation
- Included in:
- BaseContext
- Defined in:
- lib/yoda/typing/contexts/context_derivation.rb
Instance Method Summary collapse
- #constant_ref ⇒ Types::Type abstract
- #derive_block_context(binds:, receiver_type: nil) ⇒ Object
- #derive_class_context(class_type:) ⇒ Object
- #derive_method_context(receiver_type:, binds:) ⇒ Object
- #environment ⇒ Model::Environment abstract
- #receiver ⇒ Types::Type abstract
Instance Method Details
#constant_ref ⇒ Types::Type
This method is abstract.
19 20 21 |
# File 'lib/yoda/typing/contexts/context_derivation.rb', line 19 def constant_ref fail NotImplementedError end |
#derive_block_context(binds:, receiver_type: nil) ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/yoda/typing/contexts/context_derivation.rb', line 47 def derive_block_context(binds:, receiver_type: nil) BlockContext.new( parent: self, environment: environment, receiver: receiver_type || receiver, constant_ref: constant_ref, binds: binds, ) end |
#derive_class_context(class_type:) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/yoda/typing/contexts/context_derivation.rb', line 24 def derive_class_context(class_type:) NamespaceContext.new( parent: self, environment: environment, receiver: class_type, constant_ref: class_type, ) end |
#derive_method_context(receiver_type:, binds:) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/yoda/typing/contexts/context_derivation.rb', line 35 def derive_method_context(receiver_type:, binds:) MethodContext.new( parent: self, environment: environment, receiver: receiver_type, constant_ref: constant_ref, binds: binds, ) end |
#environment ⇒ Model::Environment
This method is abstract.
7 8 9 |
# File 'lib/yoda/typing/contexts/context_derivation.rb', line 7 def environment fail NotImplementedError end |
#receiver ⇒ Types::Type
This method is abstract.
13 14 15 |
# File 'lib/yoda/typing/contexts/context_derivation.rb', line 13 def receiver fail NotImplementedError end |