Class: RubyPost::PicturePrecompiler
Overview
Defines all the pictures at the front of the file
Instance Method Summary collapse
- #add_picture(s) ⇒ Object
- #compile ⇒ Object
-
#initialize ⇒ PicturePrecompiler
constructor
A new instance of PicturePrecompiler.
Constructor Details
#initialize ⇒ PicturePrecompiler
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 |
#compile ⇒ Object
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 |