Class: Contracts::KeywordArgsErrorFormatter
- Inherits:
-
DefaultErrorFormatter
- Object
- DefaultErrorFormatter
- Contracts::KeywordArgsErrorFormatter
- Defined in:
- lib/contracts/error_formatter.rb
Instance Attribute Summary
Attributes inherited from DefaultErrorFormatter
Instance Method Summary collapse
Methods inherited from DefaultErrorFormatter
Constructor Details
This class inherits a constructor from Contracts::DefaultErrorFormatter
Instance Method Details
#message ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/contracts/error_formatter.rb', line 59 def s = [] s << header.to_s s << " Expected: #{expected}" s << " Actual: #{data[:arg].inspect}" s << " Missing Contract: #{missing_contract_info}" unless missing_contract_info.empty? s << " Invalid Args: #{invalid_args_info}" unless invalid_args_info.empty? s << " Missing Args: #{missing_args_info}" unless missing_args_info.empty? s << " Value guarded in: #{data[:class]}::#{method_name}" s << " With Contract: #{data[:contracts]}" s << " At: #{position} " s.join("\n") end |