Class: Steep::TypeInference::Context::ModuleContext
- Defined in:
- lib/steep/type_inference/context.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#defined_instance_methods ⇒ Object
readonly
Returns the value of attribute defined_instance_methods.
-
#defined_module_methods ⇒ Object
readonly
Returns the value of attribute defined_module_methods.
-
#implement_name ⇒ Object
readonly
Returns the value of attribute implement_name.
-
#instance_definition ⇒ Object
readonly
Returns the value of attribute instance_definition.
-
#instance_type ⇒ Object
readonly
Returns the value of attribute instance_type.
-
#module_definition ⇒ Object
readonly
Returns the value of attribute module_definition.
-
#module_type ⇒ Object
readonly
Returns the value of attribute module_type.
-
#nesting ⇒ Object
readonly
Returns the value of attribute nesting.
Instance Method Summary collapse
- #class_variables ⇒ Object
-
#initialize(instance_type:, module_type:, implement_name:, class_name:, instance_definition: nil, module_definition: nil, nesting:) ⇒ ModuleContext
constructor
A new instance of ModuleContext.
- #update(instance_type: self.instance_type, module_type: self.module_type, implement_name: self.implement_name, class_name: self.class_name, instance_definition: self.instance_definition, module_definition: self.module_definition, nesting: self.nesting) ⇒ Object
Constructor Details
#initialize(instance_type:, module_type:, implement_name:, class_name:, instance_definition: nil, module_definition: nil, nesting:) ⇒ ModuleContext
Returns a new instance of ModuleContext.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/steep/type_inference/context.rb', line 69 def initialize(instance_type:, module_type:, implement_name:, class_name:, instance_definition: nil, module_definition: nil, nesting:) @instance_type = instance_type @module_type = module_type @defined_instance_methods = Set.new @defined_module_methods = Set.new @implement_name = implement_name @nesting = nesting @class_name = class_name @instance_definition = instance_definition @module_definition = module_definition end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
65 66 67 |
# File 'lib/steep/type_inference/context.rb', line 65 def class_name @class_name end |
#defined_instance_methods ⇒ Object (readonly)
Returns the value of attribute defined_instance_methods.
61 62 63 |
# File 'lib/steep/type_inference/context.rb', line 61 def defined_instance_methods @defined_instance_methods end |
#defined_module_methods ⇒ Object (readonly)
Returns the value of attribute defined_module_methods.
62 63 64 |
# File 'lib/steep/type_inference/context.rb', line 62 def defined_module_methods @defined_module_methods end |
#implement_name ⇒ Object (readonly)
Returns the value of attribute implement_name.
64 65 66 |
# File 'lib/steep/type_inference/context.rb', line 64 def implement_name @implement_name end |
#instance_definition ⇒ Object (readonly)
Returns the value of attribute instance_definition.
66 67 68 |
# File 'lib/steep/type_inference/context.rb', line 66 def instance_definition @instance_definition end |
#instance_type ⇒ Object (readonly)
Returns the value of attribute instance_type.
59 60 61 |
# File 'lib/steep/type_inference/context.rb', line 59 def instance_type @instance_type end |
#module_definition ⇒ Object (readonly)
Returns the value of attribute module_definition.
67 68 69 |
# File 'lib/steep/type_inference/context.rb', line 67 def module_definition @module_definition end |
#module_type ⇒ Object (readonly)
Returns the value of attribute module_type.
60 61 62 |
# File 'lib/steep/type_inference/context.rb', line 60 def module_type @module_type end |
#nesting ⇒ Object (readonly)
Returns the value of attribute nesting.
63 64 65 |
# File 'lib/steep/type_inference/context.rb', line 63 def nesting @nesting end |
Instance Method Details
#class_variables ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/steep/type_inference/context.rb', line 81 def class_variables if module_definition @class_variables ||= module_definition.class_variables.transform_values do |var_def| var_def.type end end end |
#update(instance_type: self.instance_type, module_type: self.module_type, implement_name: self.implement_name, class_name: self.class_name, instance_definition: self.instance_definition, module_definition: self.module_definition, nesting: self.nesting) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/steep/type_inference/context.rb', line 89 def update( instance_type: self.instance_type, module_type: self.module_type, implement_name: self.implement_name, class_name: self.class_name, instance_definition: self.instance_definition, module_definition: self.module_definition, nesting: self.nesting ) ModuleContext.new( instance_type: instance_type, module_type: module_type, implement_name: implement_name, nesting: nesting, class_name: class_name, instance_definition: instance_definition, module_definition: module_definition ) end |