Class: Numeric

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

Overview

Add the compile functionality to Ruby Numeric. Calling compile will add the cm, inch, bp metapost sizes to the to_s

Instance Method Summary collapse

Instance Method Details

#bpObject

[View source]

199
200
201
202
# File 'lib/objects.rb', line 199

def bp
  @mpsize = 'bp'
  self
end

#cmObject

[View source]

191
192
193
194
# File 'lib/objects.rb', line 191

def cm
  @mpsize = 'cm'
  self
end

#compileObject

A nifty thing here is that if you dont specify the size if wont print anything

[View source]

205
206
207
208
# File 'lib/objects.rb', line 205

def compile
  #@mpsize='cm' if(@mpsize==nil)
  to_s + @mpsize.to_s
end

#inchObject

[View source]

195
196
197
198
# File 'lib/objects.rb', line 195

def inch
  @mpsize = 'inch'
  self
end