Exception: Solid::Result::Contract::Error::UnexpectedValue

Inherits:
Solid::Result::Contract::Error show all
Defined in:
lib/solid/result/contract/error.rb

Class Method Summary collapse

Class Method Details

.build(type:, value:, cause: nil) ⇒ Object



11
12
13
14
15
# File 'lib/solid/result/contract/error.rb', line 11

def self.build(type:, value:, cause: nil)
  cause_message = " (#{cause.message})" if cause

  new("value #{value.inspect} is not allowed for :#{type} type#{cause_message}")
end