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 |
# File 'lib/typeprof/core/env/method_entity.rb', line 3 def initialize @builtin = nil @decls = Set[] @defs = Set[] @aliases = {} @method_call_boxes = Set[] end |
Instance Attribute Details
#aliases ⇒ Object (readonly)
Returns the value of attribute aliases.
11 12 13 |
# File 'lib/typeprof/core/env/method_entity.rb', line 11 def aliases @aliases end |
#builtin ⇒ Object
Returns the value of attribute builtin.
12 13 14 |
# File 'lib/typeprof/core/env/method_entity.rb', line 12 def builtin @builtin end |
#decls ⇒ Object (readonly)
Returns the value of attribute decls.
11 12 13 |
# File 'lib/typeprof/core/env/method_entity.rb', line 11 def decls @decls end |
#defs ⇒ Object (readonly)
Returns the value of attribute defs.
11 12 13 |
# File 'lib/typeprof/core/env/method_entity.rb', line 11 def defs @defs end |
#method_call_boxes ⇒ Object (readonly)
Returns the value of attribute method_call_boxes.
11 12 13 |
# File 'lib/typeprof/core/env/method_entity.rb', line 11 def method_call_boxes @method_call_boxes end |
Instance Method Details
#add_alias(node, old_mid) ⇒ Object
31 32 33 |
# File 'lib/typeprof/core/env/method_entity.rb', line 31 def add_alias(node, old_mid) @aliases[node] = old_mid end |
#add_decl(decl) ⇒ Object
14 15 16 |
# File 'lib/typeprof/core/env/method_entity.rb', line 14 def add_decl(decl) @decls << decl end |
#add_def(mdef) ⇒ Object
22 23 24 25 |
# File 'lib/typeprof/core/env/method_entity.rb', line 22 def add_def(mdef) @defs << mdef self end |
#add_run_all_mdefs(genv) ⇒ Object
43 44 45 46 47 |
# File 'lib/typeprof/core/env/method_entity.rb', line 43 def add_run_all_mdefs(genv) @defs.each do |mdef| genv.add_run(mdef) end end |
#add_run_all_method_call_boxes(genv) ⇒ Object
49 50 51 52 53 |
# File 'lib/typeprof/core/env/method_entity.rb', line 49 def add_run_all_method_call_boxes(genv) @method_call_boxes.each do |box| genv.add_run(box) end end |
#exist? ⇒ Boolean
39 40 41 |
# File 'lib/typeprof/core/env/method_entity.rb', line 39 def exist? @builtin || !@decls.empty? || !@defs.empty? end |
#remove_alias(node) ⇒ Object
35 36 37 |
# File 'lib/typeprof/core/env/method_entity.rb', line 35 def remove_alias(node) @aliases.delete(node) || raise end |
#remove_decl(decl) ⇒ Object
18 19 20 |
# File 'lib/typeprof/core/env/method_entity.rb', line 18 def remove_decl(decl) @decls.delete(decl) || raise end |
#remove_def(mdef) ⇒ Object
27 28 29 |
# File 'lib/typeprof/core/env/method_entity.rb', line 27 def remove_def(mdef) @defs.delete(mdef) || raise end |