Module: Syskit::Coordination::Models::PortHandling

Defined in:
lib/syskit/coordination/models/port_handling.rb

Overview

Port access code for model-level task objects

Instance Method Summary collapse

Instance Method Details

#bind(task) ⇒ Object



18
19
20
# File 'lib/syskit/coordination/models/port_handling.rb', line 18

def bind(task)
    task
end

#find_port(port_name) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/syskit/coordination/models/port_handling.rb', line 10

def find_port(port_name)
    if !model.respond_to?(:find_port)
        raise ArgumentError, "cannot access ports on #{model}: it is not a component model"
    elsif port = model.find_port(port_name)
        port.attach(self)
    end
end

#find_through_method_missing(m, args) ⇒ Object



30
31
32
# File 'lib/syskit/coordination/models/port_handling.rb', line 30

def find_through_method_missing(m, args)
    MetaRuby::DSLs.find_through_method_missing(self, m, args, "_port" => :find_port) || super
end

#has_port?(port_name) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/syskit/coordination/models/port_handling.rb', line 6

def has_port?(port_name)
    !!model.find_port(port_name)
end

#has_through_method_missing?(m) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/syskit/coordination/models/port_handling.rb', line 26

def has_through_method_missing?(m)
    MetaRuby::DSLs.has_through_method_missing?(self, m, "_port" => :has_port?) || super
end

#self_port_to_component_port(port) ⇒ Object



22
23
24
# File 'lib/syskit/coordination/models/port_handling.rb', line 22

def self_port_to_component_port(port)
    model.self_port_to_component_port(port)
end