Class: Tinge::Formatters::ASEFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/tinge/formatters/ase_formatter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Formatter

dependencies, dependency, handles, #initialize

Constructor Details

This class inherits a constructor from Tinge::Formatters::Formatter

Class Method Details

.require_filename?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/tinge/formatters/ase_formatter.rb', line 14

def self.require_filename?
  true
end

.stringify_colors?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/tinge/formatters/ase_formatter.rb', line 10

def self.stringify_colors?
  false
end

Instance Method Details

#renderObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/tinge/formatters/ase_formatter.rb', line 18

def render
  doc = ASE.new

  palette = ASE::Palette.new("Colors")
  @reporter.data.each do |name, color|
    palette.add name, ase_color(color)
  end
  doc << palette
  doc.to_file(@filename)
end