Class: TypeProf::Core::HashSplatBox
- Defined in:
- lib/typeprof/core/graph/box.rb
Instance Attribute Summary collapse
-
#hsh ⇒ Object
readonly
Returns the value of attribute hsh.
-
#unified_key ⇒ Object
readonly
Returns the value of attribute unified_key.
-
#unified_val ⇒ Object
readonly
Returns the value of attribute unified_val.
Attributes inherited from Box
Instance Method Summary collapse
-
#initialize(node, genv, hsh, unified_key, unified_val) ⇒ HashSplatBox
constructor
A new instance of HashSplatBox.
-
#ret ⇒ Object
dummy.
- #run0(genv, changes) ⇒ Object
Methods inherited from Box
#destroy, #diagnostics, #on_type_added, #on_type_removed, #reuse, #run, #to_s
Constructor Details
#initialize(node, genv, hsh, unified_key, unified_val) ⇒ HashSplatBox
Returns a new instance of HashSplatBox.
310 311 312 313 314 315 316 |
# File 'lib/typeprof/core/graph/box.rb', line 310 def initialize(node, genv, hsh, unified_key, unified_val) super(node) @hsh = hsh @unified_key = unified_key @unified_val = unified_val @hsh.add_edge(genv, self) end |
Instance Attribute Details
#hsh ⇒ Object (readonly)
Returns the value of attribute hsh.
320 321 322 |
# File 'lib/typeprof/core/graph/box.rb', line 320 def hsh @hsh end |
#unified_key ⇒ Object (readonly)
Returns the value of attribute unified_key.
320 321 322 |
# File 'lib/typeprof/core/graph/box.rb', line 320 def unified_key @unified_key end |
#unified_val ⇒ Object (readonly)
Returns the value of attribute unified_val.
320 321 322 |
# File 'lib/typeprof/core/graph/box.rb', line 320 def unified_val @unified_val end |
Instance Method Details
#ret ⇒ Object
dummy
318 |
# File 'lib/typeprof/core/graph/box.rb', line 318 def ret = @hsh # dummy |
#run0(genv, changes) ⇒ Object
322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/typeprof/core/graph/box.rb', line 322 def run0(genv, changes) @hsh.each_type do |ty| ty = ty.base_type(genv) if ty.mod == genv.mod_hash changes.add_edge(genv, ty.args[0], @unified_key) changes.add_edge(genv, ty.args[1], @unified_val) else "???" end end end |