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
185 186 187 188 |
# File 'lib/objects.rb', line 185 def bp @mpsize = 'bp' self end |
#cm ⇒ Object
177 178 179 180 |
# File 'lib/objects.rb', line 177 def cm @mpsize = 'cm' self end |
#compile ⇒ Object
A nifty thing here is that if you dont specify the size if wont print anything
191 192 193 194 |
# File 'lib/objects.rb', line 191 def compile #@mpsize='cm' if(@mpsize==nil) to_s + @mpsize.to_s end |
#inch ⇒ Object
181 182 183 184 |
# File 'lib/objects.rb', line 181 def inch @mpsize = 'inch' self end |