Class: Types::Block

Inherits:
Object
  • Object
show all
Includes:
Generic
Defined in:
lib/types/block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Generic

#|

Constructor Details

#initialize(argument_types, return_type) ⇒ Block

Returns a new instance of Block.



29
30
31
32
# File 'lib/types/block.rb', line 29

def initialize(argument_types, return_type)
	@argument_types = argument_types
	@return_type = return_type
end

Instance Attribute Details

#argument_typesObject (readonly)

Returns the value of attribute argument_types.



34
35
36
# File 'lib/types/block.rb', line 34

def argument_types
  @argument_types
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



35
36
37
# File 'lib/types/block.rb', line 35

def return_type
  @return_type
end

Instance Method Details

#composite?Boolean

Returns:



37
38
39
# File 'lib/types/block.rb', line 37

def composite?
	true
end

#to_sObject



41
42
43
44
45
46
47
# File 'lib/types/block.rb', line 41

def to_s
	if @return_type
		"Block(#{@argument_types.join(', ')}, returns: #{@return_type})"
	else
		"Block(#{@argument_types.join(', ')})"
	end
end