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.



151
152
153
# File 'lib/objects.rb', line 151

def initialize
  @draw_commands = Array.new
end

Instance Method Details

#add_drawable(d) ⇒ Object



155
156
157
# File 'lib/objects.rb', line 155

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

#compileObject



159
160
161
162
163
164
165
166
# File 'lib/objects.rb', line 159

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