Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- 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
- #bp ⇒ Object
- #cm ⇒ Object
-
#compile ⇒ Object
A nifty thing here is that if you dont specify the size if wont print anything.
- #inch ⇒ Object
Instance Method Details
#bp ⇒ Object
191 192 193 194 |
# File 'lib/objects.rb', line 191 def bp @mpsize = 'bp' self end |
#cm ⇒ Object
183 184 185 186 |
# File 'lib/objects.rb', line 183 def cm @mpsize = 'cm' self end |
#compile ⇒ Object
A nifty thing here is that if you dont specify the size if wont print anything
197 198 199 200 |
# File 'lib/objects.rb', line 197 def compile #@mpsize='cm' if(@mpsize==nil) to_s + @mpsize.to_s end |
#inch ⇒ Object
187 188 189 190 |
# File 'lib/objects.rb', line 187 def inch @mpsize = 'inch' self end |