Exception: Micro::Case::Error::UnexpectedResultType
- Inherits:
-
TypeError
- Object
- TypeError
- Micro::Case::Error::UnexpectedResultType
- Defined in:
- lib/micro/case/error.rb
Instance Method Summary collapse
-
#initialize(use_case_class, kind, type, declared_types) ⇒ UnexpectedResultType
constructor
A new instance of UnexpectedResultType.
Constructor Details
#initialize(use_case_class, kind, type, declared_types) ⇒ UnexpectedResultType
Returns a new instance of UnexpectedResultType.
64 65 66 67 68 69 70 71 72 |
# File 'lib/micro/case/error.rb', line 64 def initialize(use_case_class, kind, type, declared_types) declared_list = declared_types.map { |t| ":#{t}" }.join(', ') declared_list = '(none)' if declared_list.empty? super( "#{use_case_class.name} declared a results contract — " \ "#{kind} type :#{type} is not declared. Declared #{kind} types: #{declared_list}." ) end |