Class: TwoPorts

Inherits:
Inst
  • Object
show all
Defined in:
lib/TwoPorts.rb

Overview

This class is the superclass for all two port Inst objects Inv and Buf1 inherit from this class

Direct Known Subclasses

Buf1, Inv

Instance Attribute Summary

Attributes inherited from Inst

#inputs, #name, #nodes, #outputs

Instance Method Summary collapse

Methods inherited from Inst

#get_port

Constructor Details

#initialize(name) ⇒ TwoPorts

This method is called when a new object is instantiated, it takes the name of the Inst object (name) as its only argument. It is responsible for calling its superclass Inst and passing to it the correct number of input ports and output ports to be created.



8
9
10
# File 'lib/TwoPorts.rb', line 8

def initialize(name)
  super(name,[0],[1])
end

Instance Method Details

#abeloutObject

This method defines the connections held by the ports for this object’s subclasses.



13
14
15
# File 'lib/TwoPorts.rb', line 13

def abelout
  @p0 = self.get_port("p0").connections.collect{|p| p.name}.to_s
end