Class: BaseChip::BomType

Inherits:
Object
  • Object
show all
Defined in:
lib/base_chip/bom_file.rb

Instance Method Summary collapse

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

#makeObject



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_sObject



23
24
25
# File 'lib/base_chip/bom_file.rb', line 23

def to_s
  "#{@bom.name1}.#{@bom.name2}.#{@type}"
end