Class: HDL::Chip
- Inherits:
-
Object
- Object
- HDL::Chip
- Defined in:
- lib/hdl/chip.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #dependees ⇒ Object
- #dependents ⇒ Object
-
#initialize(name, path, data) ⇒ Chip
constructor
A new instance of Chip.
- #inspect ⇒ Object
- #primitives ⇒ Object
Constructor Details
#initialize(name, path, data) ⇒ Chip
Returns a new instance of Chip.
5 6 7 8 9 10 |
# File 'lib/hdl/chip.rb', line 5 def initialize(name, path, data) @name = name.to_s @path = path @inputs = data[:inputs] @outputs = data[:outputs] end |
Instance Attribute Details
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
3 4 5 |
# File 'lib/hdl/chip.rb', line 3 def inputs @inputs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/hdl/chip.rb', line 3 def name @name end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
3 4 5 |
# File 'lib/hdl/chip.rb', line 3 def outputs @outputs end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/hdl/chip.rb', line 3 def path @path end |
Instance Method Details
#dependees ⇒ Object
24 25 26 |
# File 'lib/hdl/chip.rb', line 24 def dependees load_dependencies(:dependees) end |
#dependents ⇒ Object
20 21 22 |
# File 'lib/hdl/chip.rb', line 20 def dependents load_dependencies(:dependents) end |
#inspect ⇒ Object
12 13 14 |
# File 'lib/hdl/chip.rb', line 12 def inspect "#<HDL::Chip #{name}>" end |
#primitives ⇒ Object
16 17 18 |
# File 'lib/hdl/chip.rb', line 16 def primitives dependents.select { |d| d.primitive? } end |