class TypeProf::Core::EscapeBox::HashSplatBox

Public Class Methods

new(node, genv, hsh, unified_key, unified_val) click to toggle source
Calls superclass method TypeProf::Core::Box::new
# File typeprof-0.30.1/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

Public Instance Methods

ret(= @hsh) click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/graph/box.rb, line 318
  def ret = @hsh # dummy

  attr_reader :hsh, :unified_key, :unified_val

  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
end
run0(genv, changes) click to toggle source
# File typeprof-0.30.1/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