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.
307 308 309 310 311 312 |
# File 'lib/steep/errors.rb', line 307 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.
302 303 304 |
# File 'lib/steep/errors.rb', line 302 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
301 302 303 |
# File 'lib/steep/errors.rb', line 301 def expected @expected end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
303 304 305 |
# File 'lib/steep/errors.rb', line 303 def result @result end |
Instance Method Details
#to_s ⇒ Object
314 315 316 317 318 319 320 321 322 323 |
# File 'lib/steep/errors.rb', line 314 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 |