Class: MilkTea::ModuleBinding
- Inherits:
-
Data
- Object
- Data
- MilkTea::ModuleBinding
- Defined in:
- lib/milk_tea/core/bindings/module_binding.rb
Instance Attribute Summary collapse
-
#attribute_applications ⇒ Object
readonly
Returns the value of attribute attribute_applications.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#implemented_interfaces ⇒ Object
readonly
Returns the value of attribute implemented_interfaces.
-
#imports ⇒ Object
readonly
Returns the value of attribute imports.
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#private_attributes ⇒ Object
readonly
Returns the value of attribute private_attributes.
-
#private_functions ⇒ Object
readonly
Returns the value of attribute private_functions.
-
#private_implemented_interfaces ⇒ Object
readonly
Returns the value of attribute private_implemented_interfaces.
-
#private_interfaces ⇒ Object
readonly
Returns the value of attribute private_interfaces.
-
#private_methods ⇒ Object
readonly
Returns the value of attribute private_methods.
-
#private_types ⇒ Object
readonly
Returns the value of attribute private_types.
-
#private_values ⇒ Object
readonly
Returns the value of attribute private_values.
-
#type_declarations ⇒ Object
readonly
Returns the value of attribute type_declarations.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #private_attribute?(name) ⇒ Boolean
- #private_function?(name) ⇒ Boolean
- #private_interface?(name) ⇒ Boolean
- #private_method?(receiver_type, name) ⇒ Boolean
- #private_type?(name) ⇒ Boolean
- #private_value?(name) ⇒ Boolean
Instance Attribute Details
#attribute_applications ⇒ Object (readonly)
Returns the value of attribute attribute_applications
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def attribute_applications @attribute_applications end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def attributes @attributes end |
#functions ⇒ Object (readonly)
Returns the value of attribute functions
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def functions @functions end |
#implemented_interfaces ⇒ Object (readonly)
Returns the value of attribute implemented_interfaces
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def implemented_interfaces @implemented_interfaces end |
#imports ⇒ Object (readonly)
Returns the value of attribute imports
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def imports @imports end |
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def interfaces @interfaces end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def methods @methods end |
#name ⇒ Object (readonly)
Returns the value of attribute name
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def name @name end |
#private_attributes ⇒ Object (readonly)
Returns the value of attribute private_attributes
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_attributes @private_attributes end |
#private_functions ⇒ Object (readonly)
Returns the value of attribute private_functions
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_functions @private_functions end |
#private_implemented_interfaces ⇒ Object (readonly)
Returns the value of attribute private_implemented_interfaces
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_implemented_interfaces @private_implemented_interfaces end |
#private_interfaces ⇒ Object (readonly)
Returns the value of attribute private_interfaces
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_interfaces @private_interfaces end |
#private_methods ⇒ Object (readonly)
Returns the value of attribute private_methods
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_methods @private_methods end |
#private_types ⇒ Object (readonly)
Returns the value of attribute private_types
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_types @private_types end |
#private_values ⇒ Object (readonly)
Returns the value of attribute private_values
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def private_values @private_values end |
#type_declarations ⇒ Object (readonly)
Returns the value of attribute type_declarations
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def type_declarations @type_declarations end |
#types ⇒ Object (readonly)
Returns the value of attribute types
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def types @types end |
#values ⇒ Object (readonly)
Returns the value of attribute values
4 5 6 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 4 def values @values end |
Instance Method Details
#private_attribute?(name) ⇒ Boolean
13 14 15 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 13 def private_attribute?(name) private_attributes.key?(name) end |
#private_function?(name) ⇒ Boolean
21 22 23 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 21 def private_function?(name) private_functions.key?(name) end |
#private_interface?(name) ⇒ Boolean
9 10 11 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 9 def private_interface?(name) private_interfaces.key?(name) end |
#private_method?(receiver_type, name) ⇒ Boolean
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 25 def private_method?(receiver_type, name) return true if private_methods.fetch(receiver_type, {}).key?(name) if receiver_type.is_a?(Types::GenericInstance) dispatch_receiver_type = Types::Registry.generic_instance( receiver_type.name, receiver_type.arguments.each_with_index.map do |argument, index| argument.is_a?(Types::LiteralTypeArg) ? argument : Types::TypeVar.new("__receiver_arg#{index}") end, ) return true if dispatch_receiver_type != receiver_type && private_methods.fetch(dispatch_receiver_type, {}).key?(name) end if receiver_type.is_a?(Types::Nullable) dispatch_base_type = receiver_type.base if dispatch_base_type.is_a?(Types::StructInstance) dispatch_base_type = dispatch_base_type.definition elsif dispatch_base_type.is_a?(Types::GenericInstance) dispatch_base_type = Types::Registry.generic_instance( dispatch_base_type.name, dispatch_base_type.arguments.each_with_index.map do |argument, index| argument.is_a?(Types::LiteralTypeArg) ? argument : Types::TypeVar.new("__receiver_arg#{index}") end, ) end dispatch_receiver_type = Types::Registry.nullable(dispatch_base_type) return true if dispatch_receiver_type != receiver_type && private_methods.fetch(dispatch_receiver_type, {}).key?(name) end receiver_type.is_a?(Types::StructInstance) && private_methods.fetch(receiver_type.definition, {}).key?(name) end |
#private_type?(name) ⇒ Boolean
5 6 7 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 5 def private_type?(name) private_types.key?(name) end |
#private_value?(name) ⇒ Boolean
17 18 19 |
# File 'lib/milk_tea/core/bindings/module_binding.rb', line 17 def private_value?(name) private_values.key?(name) end |