module RubyBreaker::Runtime::Inspector
This module inspects type information gathered so far.
Public Class Methods
inspect_all(mod)
click to toggle source
This method inspects the module for all methods. It returns a Hash containing (method name, method type) pairs.
# File lib/rubybreaker/runtime/inspector.rb, line 41 def self.inspect_all(mod) mtypes = {} mm = TYPE_MAP[mod] mm.each_pair {|im,mtype| mtypes[im] = mtype if mtype } if mm return mtypes end
inspect_class_meth(mod, mname)
click to toggle source
This method inspects the module for the specified class method name. This is a shorthand for calling inspect_meth
with the eigen class.
# File lib/rubybreaker/runtime/inspector.rb, line 25 def self.inspect_class_meth(mod, mname) eigen_class = Runtime.eigen_class(mod) return self.inspect_meth(eigen_class, mname) end
inspect_meth(mod, mname)
click to toggle source
This method inspects the module for the type of the specified method.
# File lib/rubybreaker/runtime/inspector.rb, line 17 def self.inspect_meth(mod, mname) mname = mname.to_sym t = TYPE_MAP[mod][mname] if TYPE_MAP.has_key?(mod) return t end
inspect_meths(mod, mnames)
click to toggle source
Similar to inspect_meth
but returns a hash of (mname, mtype) pairs.
# File lib/rubybreaker/runtime/inspector.rb, line 31 def self.inspect_meths(mod, mnames) mtype_hash = {} mnames.each {|mname| mtype_hash[mname] = self.inspect_meth(mod, mname) } return mtype_hash end