Class: Latex2Image::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/latex2image/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(latex, output = nil) ⇒ Generator

Returns a new instance of Generator.



5
6
7
8
# File 'lib/latex2image/generator.rb', line 5

def initialize(latex, output=nil)
  @latex = latex
  @output = output.nil? ? Tempfile.new(%w(latex2image png)) : File.new(output, 'w+')
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



3
4
5
# File 'lib/latex2image/generator.rb', line 3

def output
  @output
end

Instance Method Details

#generateObject



10
11
12
13
14
15
# File 'lib/latex2image/generator.rb', line 10

def generate
  generate_dvi
  generate_png

  self
end