Class: BaseChip::BomType
- Inherits:
-
Object
- Object
- BaseChip::BomType
- Defined in:
- lib/base_chip/bom_file.rb
Instance Method Summary collapse
-
#initialize(bom, type) ⇒ BomType
constructor
A new instance of BomType.
- #make ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(bom, type) ⇒ BomType
Returns a new instance of BomType.
19 20 21 22 |
# File 'lib/base_chip/bom_file.rb', line 19 def initialize(bom,type) @bom = bom @type = type end |
Instance Method Details
#make ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/base_chip/bom_file.rb', line 26 def make f = File.open(to_s,'w') case @type when :text ; f.puts @bom.to_a.join("\n") when :tcl ; fault "TCL formatted bom files not yet implemented" else ; fault "#{@type.inspect} was not understood by #{self.class}" end f.close end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/base_chip/bom_file.rb', line 23 def to_s "#{@bom.name1}.#{@bom.name2}.#{@type}" end |