Class: Steep::Errors::MethodBodyTypeMismatch
- Includes:
- ResultPrinter
- Defined in:
- lib/steep/errors.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(node:, expected:, actual:, result:) ⇒ MethodBodyTypeMismatch
constructor
A new instance of MethodBodyTypeMismatch.
- #to_s ⇒ Object
Methods included from ResultPrinter
Methods inherited from Base
Constructor Details
#initialize(node:, expected:, actual:, result:) ⇒ MethodBodyTypeMismatch
Returns a new instance of MethodBodyTypeMismatch.
298 299 300 301 302 303 |
# File 'lib/steep/errors.rb', line 298 def initialize(node:, expected:, actual:, result:) super(node: node) @expected = expected @actual = actual @result = result end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
293 294 295 |
# File 'lib/steep/errors.rb', line 293 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
292 293 294 |
# File 'lib/steep/errors.rb', line 292 def expected @expected end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
294 295 296 |
# File 'lib/steep/errors.rb', line 294 def result @result end |
Instance Method Details
#to_s ⇒ Object
305 306 307 308 309 310 311 312 313 314 |
# File 'lib/steep/errors.rb', line 305 def to_s method = case node.type when :def node.children[0] when :defs prefix = node.children[0].type == :self ? "self" : "*" "#{prefix}.#{node.children[1]}" end "#{location_to_str}: MethodBodyTypeMismatch: method=#{method}, expected=#{expected}, actual=#{actual}" end |