Exception: Exwiw::MongoidSchemaGenerator::UnsupportedEmbedding
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Exwiw::MongoidSchemaGenerator::UnsupportedEmbedding
- Defined in:
- lib/exwiw/mongoid_schema_generator.rb
Overview
Raised when an embedded collection’s ‘embedded_in` cannot be expressed as an exwiw config (polymorphic embedding, self-referential/cyclic embedding, or an unresolvable embedding-parent class). A subclass of ArgumentError so the historical `raise_error(ArgumentError, …)` contract is preserved. Under `skip_unsupported` the generator rescues this and emits an `ignore: true` config instead of aborting the whole run.
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
A concise phrase (as opposed to the long, actionable exception message) recorded as the generated config’s ‘comment`.
Instance Method Summary collapse
-
#initialize(message, reason:) ⇒ UnsupportedEmbedding
constructor
A new instance of UnsupportedEmbedding.
Constructor Details
#initialize(message, reason:) ⇒ UnsupportedEmbedding
Returns a new instance of UnsupportedEmbedding.
28 29 30 31 |
# File 'lib/exwiw/mongoid_schema_generator.rb', line 28 def initialize(, reason:) super() @reason = reason end |
Instance Attribute Details
#reason ⇒ Object (readonly)
A concise phrase (as opposed to the long, actionable exception message) recorded as the generated config’s ‘comment`.
26 27 28 |
# File 'lib/exwiw/mongoid_schema_generator.rb', line 26 def reason @reason end |