Class: Steep::Errors::ArgumentTypeMismatch

Inherits:
Base
  • Object
show all
Defined in:
lib/steep/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#location_to_str, #print_to

Constructor Details

#initialize(node:, receiver_type:, expected:, actual:) ⇒ ArgumentTypeMismatch

Returns a new instance of ArgumentTypeMismatch.



83
84
85
86
87
88
# File 'lib/steep/errors.rb', line 83

def initialize(node:, receiver_type:, expected:, actual:)
  super(node: node)
  @receiver_type = receiver_type
  @expected = expected
  @actual = actual
end

Instance Attribute Details

#actualObject (readonly)

Returns the value of attribute actual.



80
81
82
# File 'lib/steep/errors.rb', line 80

def actual
  @actual
end

#expectedObject (readonly)

Returns the value of attribute expected.



79
80
81
# File 'lib/steep/errors.rb', line 79

def expected
  @expected
end

#nodeObject (readonly)

Returns the value of attribute node.



78
79
80
# File 'lib/steep/errors.rb', line 78

def node
  @node
end

#receiver_typeObject (readonly)

Returns the value of attribute receiver_type.



81
82
83
# File 'lib/steep/errors.rb', line 81

def receiver_type
  @receiver_type
end

Instance Method Details

#to_sObject



90
91
92
# File 'lib/steep/errors.rb', line 90

def to_s
  "#{location_to_str}: ArgumentTypeMismatch: receiver=#{receiver_type}, expected=#{expected}, actual=#{actual}"
end