Class: HDL::Chip

Inherits:
Object
  • Object
show all
Defined in:
lib/hdl/chip.rb

Direct Known Subclasses

SchemaChip, TableChip

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#inputsObject (readonly)

Returns the value of attribute inputs.



3
4
5
# File 'lib/hdl/chip.rb', line 3

def inputs
  @inputs
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/hdl/chip.rb', line 3

def name
  @name
end

#outputsObject (readonly)

Returns the value of attribute outputs.



3
4
5
# File 'lib/hdl/chip.rb', line 3

def outputs
  @outputs
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/hdl/chip.rb', line 3

def path
  @path
end

Instance Method Details

#dependeesObject



24
25
26
# File 'lib/hdl/chip.rb', line 24

def dependees
  load_dependencies(:dependees)
end

#dependentsObject



20
21
22
# File 'lib/hdl/chip.rb', line 20

def dependents
  load_dependencies(:dependents)
end

#inspectObject



12
13
14
# File 'lib/hdl/chip.rb', line 12

def inspect
  "#<HDL::Chip #{name}>"
end

#primitivesObject



16
17
18
# File 'lib/hdl/chip.rb', line 16

def primitives
  dependents.select { |d| d.primitive? }
end