Exception: Syskit::InvalidComponentSelection

Inherits:
InstanciationError show all
Defined in:
lib/syskit/exceptions.rb

Overview

Exception raised when the dependency injection resolves to a selection that is not compatible with the expected type

Instance Attribute Summary collapse

Attributes inherited from InstanciationError

#instanciation_chain

Instance Method Summary collapse

Constructor Details

#initialize(expected_model, name, model) ⇒ InvalidComponentSelection

Returns a new instance of InvalidComponentSelection



596
597
598
599
# File 'lib/syskit/exceptions.rb', line 596

def initialize(expected_model, name, model)
    @expected_model, @name, @model =
        expected_model, name, model
end

Instance Attribute Details

#expected_modelObject (readonly)

Model<DataService>,Model<Component>

the expected model



589
590
591
# File 'lib/syskit/exceptions.rb', line 589

def expected_model
  @expected_model
end

#modelObject (readonly)

Model<DataService>,Model<Component>

the model found by the

dependency injection



594
595
596
# File 'lib/syskit/exceptions.rb', line 594

def model
  @model
end

#nameObject (readonly)

String

the selection name



591
592
593
# File 'lib/syskit/exceptions.rb', line 591

def name
  @name
end

Instance Method Details

#pretty_print(pp) ⇒ Object



601
602
603
# File 'lib/syskit/exceptions.rb', line 601

def pretty_print(pp)
    pp.text "model #{expected_model.short_name} found for '#{name}' is incompatible with the expected model #{expected_model.short_name}"
end