Class: ThreePorts
Overview
This class is the superclass for all three port Inst objects Nor2, Nand2c, Xor2, Nand2, and Nor2c inherit from this class
Instance Attribute Summary
Attributes inherited from Inst
#inputs, #name, #nodes, #outputs
Instance Method Summary collapse
-
#abelout ⇒ Object
This method defines the connections held by the ports for this object’s subclasses.
-
#initialize(name) ⇒ ThreePorts
constructor
This method is called when a new object is instantiated, it takes the name of the Inst object (name) as its only argument.
Methods inherited from Inst
Constructor Details
#initialize(name) ⇒ ThreePorts
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/ThreePorts.rb', line 8 def initialize(name) super(name,[0,1],[2]) end |
Instance Method Details
#abelout ⇒ Object
This method defines the connections held by the ports for this object’s subclasses.
13 14 15 16 |
# File 'lib/ThreePorts.rb', line 13 def abelout @p0 = self.get_port("p0").connections.collect{|p| p.name}.to_s @p1 = self.get_port("p1").connections.collect{|p| p.name}.to_s end |