Class: Yadriggy::ResultType

Inherits:
OptionalRole show all
Defined in:
lib/yadriggy/type.rb

Overview

Type of values returned by a method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OptionalRole

#==, #supertype

Methods inherited from Type

#!=, #<=, #copy, #eql?, error_found!, #exact_type, #has_role?, #name, role, #supertype

Constructor Details

#initialize(type, method_def) ⇒ ResultType

Returns a new instance of ResultType.

Parameters:

  • type (Type)

    a Type object that this role is added to.

  • method_def (Parameters)

    the method.



728
729
730
731
# File 'lib/yadriggy/type.rb', line 728

def initialize(type, method_def)
  super(type)
  @method_def = method_def
end

Instance Attribute Details

#method_defParameters (readonly)

Returns The definition of the method returning a value of this type.

Returns:

  • (Parameters)

    The definition of the method returning a value of this type.



724
725
726
# File 'lib/yadriggy/type.rb', line 724

def method_def
  @method_def
end