Class: Output
Overview
This class defines the Output port instance.
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 of this object and returns the specific ABEL code to be output for this object based on the connections on its input port.
-
#initialize(name) ⇒ Output
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) ⇒ Output
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 defining applicable output pins, then calling its superclass, OnePort, to complete other tasks.
5 6 7 8 |
# File 'lib/Output.rb', line 5 def initialize(name) super(name,[0],[]) self.outputs = "#{self.name}p0\tpin;\n" end |
Instance Method Details
#abelout ⇒ Object
This method defines the connections held by the ports of this object and returns the specific ABEL code to be output for this object based on the connections on its input port.
12 13 14 15 16 |
# File 'lib/Output.rb', line 12 def abelout # make this a class variable just for consistency's sake @p0 = self.get_port("p0").connections.collect{|p| p.name}.to_s "#{self.name}p0 = #{@p0};\n" end |