Class: TypeProf::Core::MethodEntity
- Inherits:
-
Object
- Object
- TypeProf::Core::MethodEntity
- Defined in:
- lib/typeprof/core/env/method_entity.rb
Instance Attribute Summary collapse
-
#aliases ⇒ Object
readonly
Returns the value of attribute aliases.
-
#builtin ⇒ Object
Returns the value of attribute builtin.
-
#decls ⇒ Object
readonly
Returns the value of attribute decls.
-
#defs ⇒ Object
readonly
Returns the value of attribute defs.
-
#method_call_boxes ⇒ Object
readonly
Returns the value of attribute method_call_boxes.
Instance Method Summary collapse
- #add_alias(node, old_mid) ⇒ Object
- #add_decl(decl) ⇒ Object
- #add_def(mdef) ⇒ Object
- #add_run_all_mdefs(genv) ⇒ Object
- #add_run_all_method_call_boxes(genv) ⇒ Object
- #exist? ⇒ Boolean
-
#initialize ⇒ MethodEntity
constructor
A new instance of MethodEntity.
- #remove_alias(node) ⇒ Object
- #remove_decl(decl) ⇒ Object
- #remove_def(mdef) ⇒ Object
Constructor Details
#initialize ⇒ MethodEntity
Returns a new instance of MethodEntity.
3 4 5 6 7 8 9 10 |
# File 'lib/typeprof/core/env/method_entity.rb', line 3 def initialize @builtin = nil @decls = Set[] @overloading_decls = Set[] @defs = Set[] @aliases = {} @method_call_boxes = Set[] end |
Instance Attribute Details
#aliases ⇒ Object (readonly)
Returns the value of attribute aliases.
12 13 14 |
# File 'lib/typeprof/core/env/method_entity.rb', line 12 def aliases @aliases end |
#builtin ⇒ Object
Returns the value of attribute builtin.
13 14 15 |
# File 'lib/typeprof/core/env/method_entity.rb', line 13 def builtin @builtin end |
#decls ⇒ Object (readonly)
Returns the value of attribute decls.
12 13 14 |
# File 'lib/typeprof/core/env/method_entity.rb', line 12 def decls @decls end |
#defs ⇒ Object (readonly)
Returns the value of attribute defs.
12 13 14 |
# File 'lib/typeprof/core/env/method_entity.rb', line 12 def defs @defs end |
#method_call_boxes ⇒ Object (readonly)
Returns the value of attribute method_call_boxes.
12 13 14 |
# File 'lib/typeprof/core/env/method_entity.rb', line 12 def method_call_boxes @method_call_boxes end |
Instance Method Details
#add_alias(node, old_mid) ⇒ Object
40 41 42 |
# File 'lib/typeprof/core/env/method_entity.rb', line 40 def add_alias(node, old_mid) @aliases[node] = old_mid end |
#add_decl(decl) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/typeprof/core/env/method_entity.rb', line 15 def add_decl(decl) if decl.overloading @overloading_decls << decl else @decls << decl end end |
#add_def(mdef) ⇒ Object
31 32 33 34 |
# File 'lib/typeprof/core/env/method_entity.rb', line 31 def add_def(mdef) @defs << mdef self end |
#add_run_all_mdefs(genv) ⇒ Object
52 53 54 55 56 |
# File 'lib/typeprof/core/env/method_entity.rb', line 52 def add_run_all_mdefs(genv) @defs.each do |mdef| genv.add_run(mdef) end end |
#add_run_all_method_call_boxes(genv) ⇒ Object
58 59 60 61 62 |
# File 'lib/typeprof/core/env/method_entity.rb', line 58 def add_run_all_method_call_boxes(genv) @method_call_boxes.each do |box| genv.add_run(box) end end |
#exist? ⇒ Boolean
48 49 50 |
# File 'lib/typeprof/core/env/method_entity.rb', line 48 def exist? @builtin || !@decls.empty? || !@defs.empty? end |
#remove_alias(node) ⇒ Object
44 45 46 |
# File 'lib/typeprof/core/env/method_entity.rb', line 44 def remove_alias(node) @aliases.delete(node) || raise end |
#remove_decl(decl) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/typeprof/core/env/method_entity.rb', line 23 def remove_decl(decl) if decl.overloading @overloading_decls.delete(decl) || raise else @decls.delete(decl) || raise end end |
#remove_def(mdef) ⇒ Object
36 37 38 |
# File 'lib/typeprof/core/env/method_entity.rb', line 36 def remove_def(mdef) @defs.delete(mdef) || raise end |