Class: Syskit::Models::InputWriter

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) ⇒ InputWriter

Returns a new instance of InputWriter



296
297
298
299
# File 'lib/syskit/models/port.rb', line 296

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

Instance Attribute Details

#policyObject (readonly)

Returns the value of attribute policy



294
295
296
# File 'lib/syskit/models/port.rb', line 294

def policy
  @policy
end

#portObject (readonly)

Returns the value of attribute port



293
294
295
# File 'lib/syskit/models/port.rb', line 293

def port
  @port
end

Instance Method Details

#==(other) ⇒ Object



303
304
305
# File 'lib/syskit/models/port.rb', line 303

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

#bind(port_or_task) ⇒ Object



307
308
309
310
311
312
313
# File 'lib/syskit/models/port.rb', line 307

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#hashObject



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

def hash; [port, policy].hash end

#instanciate(plan) ⇒ Object



315
316
317
# File 'lib/syskit/models/port.rb', line 315

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

#new_sampleObject



319
320
321
# File 'lib/syskit/models/port.rb', line 319

def new_sample
    port.new_sample
end