Exception: Syskit::InvalidCompositionChildSelection
- Inherits:
-
InstanciationError
- Object
- RuntimeError
- SpecError
- InstanciationError
- Syskit::InvalidCompositionChildSelection
- Defined in:
- lib/syskit/exceptions.rb
Overview
Exception raised when the user provided a composition child selection that is not compatible with the child definition
Instance Attribute Summary collapse
-
#child_name ⇒ Object
readonly
The child name for which the selection is invalid.
-
#composition_model ⇒ Object
readonly
The composition model.
-
#required_models ⇒ Object
readonly
The model required by the composition for
child_name
. -
#selected_model ⇒ Object
readonly
The model selected by the user.
Attributes inherited from InstanciationError
Instance Method Summary collapse
-
#initialize(composition_model, child_name, selected_model, required_models) ⇒ InvalidCompositionChildSelection
constructor
A new instance of InvalidCompositionChildSelection.
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(composition_model, child_name, selected_model, required_models) ⇒ InvalidCompositionChildSelection
Returns a new instance of InvalidCompositionChildSelection
618 619 620 621 622 |
# File 'lib/syskit/exceptions.rb', line 618 def initialize(composition_model, child_name, selected_model, required_models) super() @composition_model, @child_name, @selected_model, @required_models = composition_model, child_name, selected_model, required_models end |
Instance Attribute Details
#child_name ⇒ Object (readonly)
The child name for which the selection is invalid
612 613 614 |
# File 'lib/syskit/exceptions.rb', line 612 def child_name @child_name end |
#composition_model ⇒ Object (readonly)
The composition model
610 611 612 |
# File 'lib/syskit/exceptions.rb', line 610 def composition_model @composition_model end |
#required_models ⇒ Object (readonly)
The model required by the composition for child_name
616 617 618 |
# File 'lib/syskit/exceptions.rb', line 616 def required_models @required_models end |
#selected_model ⇒ Object (readonly)
The model selected by the user
614 615 616 |
# File 'lib/syskit/exceptions.rb', line 614 def selected_model @selected_model end |
Instance Method Details
#pretty_print(pp) ⇒ Object
624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/syskit/exceptions.rb', line 624 def pretty_print(pp) pp.text "cannot use #{selected_model.short_name} for the child #{child_name} of #{composition_model.short_name}" pp.breakable pp.text "it does not provide the required models" pp.nest(2) do pp.breakable pp.seplist(required_models) do |m| pp.text m.short_name end end end |