Exception: Lutaml::Model::PolymorphicError
- Defined in:
- lib/lutaml/model/error/polymorphic_error.rb
Instance Method Summary collapse
-
#initialize(value, options, type) ⇒ PolymorphicError
constructor
A new instance of PolymorphicError.
Constructor Details
#initialize(value, options, type) ⇒ PolymorphicError
Returns a new instance of PolymorphicError.
4 5 6 7 8 9 10 11 |
# File 'lib/lutaml/model/error/polymorphic_error.rb', line 4 def initialize(value, , type) error = if [:polymorphic].is_a?(Array) "#{value.class} not in #{options[:polymorphic]}" else "#{value.class} is not valid sub class of #{type}" end super(error) end |