Class: Yoda::Typing::Inferencer::ParameterBinder::BoundResult

Inherits:
Object
  • Object
show all
Defined in:
lib/yoda/typing/inferencer/parameter_binder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, parameter:, generator:) ⇒ BoundResult

Returns a new instance of BoundResult.

Parameters:



35
36
37
38
39
# File 'lib/yoda/typing/inferencer/parameter_binder.rb', line 35

def initialize(type:, parameter:, generator:)
  @type = type
  @parameter = parameter
  @generator = generator
end

Instance Attribute Details

#generatorTypes::Generator (readonly)

Returns:



30
31
32
# File 'lib/yoda/typing/inferencer/parameter_binder.rb', line 30

def generator
  @generator
end

#parameterModel::Parameters::Base (readonly)



27
28
29
# File 'lib/yoda/typing/inferencer/parameter_binder.rb', line 27

def parameter
  @parameter
end

#typeRBS::MethodType (readonly)

Returns:

  • (RBS::MethodType)


24
25
26
# File 'lib/yoda/typing/inferencer/parameter_binder.rb', line 24

def type
  @type
end

Instance Method Details

#type_bindingHash{Symbol => Interface}

Returns:

  • (Hash{Symbol => Interface})


42
43
44
45
46
47
48
49
50
51
52
# File 'lib/yoda/typing/inferencer/parameter_binder.rb', line 42

def type_binding
  @type_binding ||= begin
    bind = TypeBinding.new

    bind_positional_parameters(bind)
    bind_keyword_parameters(bind)
    bind_block_parameter(bind)

    bind
  end
end