Class: TypeProf::Type::Proc
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::TypeProf::Type
|
|
Instance Chain:
|
|
Inherits: |
TypeProf::Type
|
Defined in: | lib/typeprof/type.rb |
Constant Summary
::TypeProf::Type
- Inherited
Class Method Summary
- .new(block_body, base_type) ⇒ Proc constructor
::TypeProf::Type
- Inherited
Instance Attribute Summary
- #base_type readonly
- #block_body readonly
Instance Method Summary
- #consistent?(other) ⇒ Boolean
- #include_untyped?(scratch) ⇒ Boolean
- #method_dispatch_info
- #screen_name(scratch)
- #substitute(subst, depth)
::TypeProf::Type
- Inherited
Constructor Details
.new(block_body, base_type) ⇒ Proc
# File 'lib/typeprof/type.rb', line 628
def initialize(block_body, base_type) @block_body, @base_type = block_body, base_type end
Instance Attribute Details
#base_type (readonly)
[ GitHub ]# File 'lib/typeprof/type.rb', line 632
attr_reader :block_body, :base_type
#block_body (readonly)
[ GitHub ]# File 'lib/typeprof/type.rb', line 632
attr_reader :block_body, :base_type
Instance Method Details
#consistent?(other) ⇒ Boolean
# File 'lib/typeprof/type.rb', line 634
def consistent?(other) case other when Type::Proc @block_body.consistent?(other.block_body) else self == other end end
#include_untyped?(scratch) ⇒ Boolean
# File 'lib/typeprof/type.rb', line 655
def include_untyped?(scratch) false # XXX: need to check the block signatures recursively end
#method_dispatch_info
[ GitHub ]# File 'lib/typeprof/type.rb', line 643
def method_dispatch_info @base_type.method_dispatch_info end
#screen_name(scratch)
[ GitHub ]# File 'lib/typeprof/type.rb', line 651
def screen_name(scratch) scratch.show_proc_signature([self]) end
#substitute(subst, depth)
[ GitHub ]# File 'lib/typeprof/type.rb', line 647
def substitute(subst, depth) Proc.new(@block_body.substitute(subst, depth), @base_type) end