Class: RubyBreaker::TypeDefs::BlockType

Inherits:
Type
  • Object
show all
Defined in:
lib/rubybreaker/type/type.rb

Overview

This class represents a block (in a method). It has zero or more argument types, nested block type (optional), and a return type.

Direct Known Subclasses

MethodType

Instance Attribute Summary collapse

Attributes inherited from Type

#ctx

Instance Method Summary collapse

Methods inherited from Type

#eql?, #subtype_of?, #unparse

Constructor Details

#initialize(arg_types = [], blk_type = nil, ret_type = nil, *args) ⇒ BlockType

Returns a new instance of BlockType.



165
166
167
168
169
170
# File 'lib/rubybreaker/type/type.rb', line 165

def initialize(arg_types=[],blk_type=nil,ret_type=nil,*args)
  super(*args)
  @arg_types = arg_types
  @blk_type = blk_type
  @ret_type = ret_type
end

Instance Attribute Details

#arg_typesObject

This accessor sets/gets the argument types for this block type.



157
158
159
# File 'lib/rubybreaker/type/type.rb', line 157

def arg_types
  @arg_types
end

#blk_typeObject

This accessor sets/gets the block type for this block type.



160
161
162
# File 'lib/rubybreaker/type/type.rb', line 160

def blk_type
  @blk_type
end

#ret_typeObject

This accessor sets/gets the return type for this block type.



163
164
165
# File 'lib/rubybreaker/type/type.rb', line 163

def ret_type
  @ret_type
end