class Syskit::Models::InvalidCompositionChildPort

Attributes

child_name[R]
composition_model[R]
existing_ports[R]
port_name[R]

Public Class Methods

new(composition_model, child_name, port_name) click to toggle source
# File lib/syskit/models/composition_child.rb, line 206
def initialize(composition_model, child_name, port_name)
    @composition_model, @child_name, @port_name =
        composition_model, child_name, port_name
    @existing_ports = composition_model.find_child(child_name).each_required_model.map do |child_model|
        [child_model, child_model.each_input_port.sort_by(&:name), child_model.each_output_port.sort_by(&:name)]
    end
end

Public Instance Methods

pretty_print(pp) click to toggle source
# File lib/syskit/models/composition_child.rb, line 214
def pretty_print(pp)
    pp.text "port #{port_name} of child #{child_name} of #{composition_model.short_name} does not exist"
    pp.breakable
    pp.text "Available ports are:"
    pp.nest(2) do
        pp.breakable
        pp.seplist(existing_ports) do |child_model, inputs, outputs|
            pp.text child_model.short_name
            pp.nest(2) do
                pp.breakable
                pp.seplist(inputs) do |port|
                    pp.text "(in)#{port.name}[#{port.type_name}]"
                end
                pp.breakable
                pp.seplist(outputs) do |port|
                    pp.text "(out)#{port.name}[#{port.type_name}]"
                end
            end
        end
    end
end