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.



157
158
159
# File 'lib/objects.rb', line 157

def initialize
  @draw_commands = Array.new
end

Instance Method Details

#add_drawable(d) ⇒ Object



161
162
163
# File 'lib/objects.rb', line 161

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

#compileObject



165
166
167
168
169
170
171
172
# File 'lib/objects.rb', line 165

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