Class: Syskit::Models::OutputReader

Inherits:
Object
  • Object
show all
Defined in:
lib/syskit/models/port.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port, policy = Hash.new) ⇒ OutputReader

Returns a new instance of OutputReader



262
263
264
265
# File 'lib/syskit/models/port.rb', line 262

def initialize(port, policy = Hash.new)
    @port = port
    @policy = policy
end

Instance Attribute Details

#policyObject (readonly)

Returns the value of attribute policy



260
261
262
# File 'lib/syskit/models/port.rb', line 260

def policy
  @policy
end

#portObject (readonly)

Returns the value of attribute port



259
260
261
# File 'lib/syskit/models/port.rb', line 259

def port
  @port
end

Instance Method Details

#==(other) ⇒ Object



269
270
271
# File 'lib/syskit/models/port.rb', line 269

def ==(other)
    other.port == port && other.policy == policy
end

#bind(port_or_task) ⇒ Object



273
274
275
276
277
278
279
# File 'lib/syskit/models/port.rb', line 273

def bind(port_or_task)
    if port_or_task.respond_to?(:reader)
        port_or_task.reader(policy)
    else
        port.bind(port_or_task).reader(policy)
    end
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


268
# File 'lib/syskit/models/port.rb', line 268

def eql?(other); self == other end

#hashObject



267
# File 'lib/syskit/models/port.rb', line 267

def hash; [port, policy].hash end

#instanciate(plan) ⇒ Object



281
282
283
# File 'lib/syskit/models/port.rb', line 281

def instanciate(plan)
    port.instanciate(plan).reader(policy)
end