Class: RubyPost::Figure

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

Overview

wrapper for the metapost figure Figures actually become the figures that will to be viewed

Instance Method Summary collapse

Constructor Details

#initializeFigure

Returns a new instance of Figure.



165
166
167
# File 'lib/objects.rb', line 165

def initialize
  @draw_commands = Array.new
end

Instance Method Details

#add_drawable(d) ⇒ Object



169
170
171
# File 'lib/objects.rb', line 169

def add_drawable(d)
  @draw_commands.push(d)
end

#compileObject



173
174
175
176
177
178
179
180
# File 'lib/objects.rb', line 173

def compile
  str = String.new
  @draw_commands.each do |d| 
    str = str + d.compile +  "\n"
  end
  str = str + "endfig;\n"
  return str
end