Class: RubyPost::PicturePrecompiler

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

Overview

Defines all the pictures at the front of the file

Instance Method Summary collapse

Constructor Details

#initializePicturePrecompiler

Returns a new instance of PicturePrecompiler.



37
38
39
# File 'lib/objects.rb', line 37

def initialize
  @pictures = Array.new
end

Instance Method Details

#add_picture(s) ⇒ Object



41
42
43
# File 'lib/objects.rb', line 41

def add_picture(s)
  @pictures.push(s)
end

#compileObject



45
46
47
48
49
50
51
# File 'lib/objects.rb', line 45

def compile
  str = "picture " + @@org_picture + ";\n" + @@org_picture + " := currentpicture;\n"
  @pictures.each do
    |p| str = str + p.precompile + "\n"
  end
  str
end