Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/sketchup-api-stubs/stubs/numeric.rb
Overview
A number of methods have been added to the Ruby Numeric class to do units conversions.
Instance Method Summary collapse
-
#cm ⇒ Length
The cm method is used to convert from centimeters to inches.
-
#degrees ⇒ Float
The degrees method is used to convert from degrees to radians.
-
#feet ⇒ Length
The feet method is used to convert from feet to inches.
-
#inch ⇒ Length
The to_l is used to convert from a number to a length.
-
#km ⇒ Length
The km method is used to convert from kilometers to inches.
-
#m ⇒ Length
The m method is used to convert from meters to inches.
-
#mile ⇒ Length
The mile method is used to convert from miles to inches.
-
#mm ⇒ Length
The mm method is used to convert from millimeters to inches.
-
#radians ⇒ Float
The radians method is used to convert from radians to degrees.
-
#to_cm ⇒ Float
The to_cm method is used to convert from inches to centimeters.
-
#to_feet ⇒ Float
The to_feet method is used to convert from inches to feet.
-
#to_inch ⇒ Float
The to_inch method converts from inches to inches.
-
#to_km ⇒ Float
The to_km method is used to convert from inches to kilometers.
-
#to_l ⇒ Length
The to_l is used to convert from a number to a length.
-
#to_m ⇒ Float
The to_m method is used to convert from inches to meters.
-
#to_mile ⇒ Float
The to_mile method is used to convert from inches to miles.
-
#to_mm ⇒ Float
The to_mm method is used to convert from inches to millimeters.
-
#to_yard ⇒ Float
The to_yard method is used to convert from inches to yards.
-
#yard ⇒ Length
The yard method is used to convert from yards to inches.
Instance Method Details
#cm ⇒ Length
The cm method is used to convert from centimeters to inches.
21 22 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 21 def cm end |
#degrees ⇒ Float
The degrees method is used to convert from degrees to radians.
For example 90.degrees would return 1.5707963267949
35 36 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 35 def degrees end |
#feet ⇒ Length
The feet method is used to convert from feet to inches.
47 48 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 47 def feet end |
#inch ⇒ Length
The to_l is used to convert from a number to a length.
59 60 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 59 def inch end |
#km ⇒ Length
The km method is used to convert from kilometers to inches.
71 72 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 71 def km end |
#m ⇒ Length
The m method is used to convert from meters to inches.
83 84 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 83 def m end |
#mile ⇒ Length
The mile method is used to convert from miles to inches.
95 96 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 95 def mile end |
#mm ⇒ Length
The mm method is used to convert from millimeters to inches.
It returns a Length value which is the same length as the given value. For example len = 25.4.mm returns 1 inch.
110 111 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 110 def mm end |
#radians ⇒ Float
The radians method is used to convert from radians to degrees.
For example, 1.5707963267949.radians would return 90.0
124 125 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 124 def radians end |
#to_cm ⇒ Float
The to_cm method is used to convert from inches to centimeters.
136 137 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 136 def to_cm end |
#to_feet ⇒ Float
The to_feet method is used to convert from inches to feet.
148 149 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 148 def to_feet end |
#to_inch ⇒ Float
The to_inch method converts from inches to inches.
This does not change the value.
162 163 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 162 def to_inch end |
#to_km ⇒ Float
The to_km method is used to convert from inches to kilometers.
174 175 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 174 def to_km end |
#to_l ⇒ Length
The to_l is used to convert from a number to a length.
186 187 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 186 def to_l end |
#to_m ⇒ Float
The to_m method is used to convert from inches to meters.
198 199 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 198 def to_m end |
#to_mile ⇒ Float
The to_mile method is used to convert from inches to miles.
210 211 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 210 def to_mile end |
#to_mm ⇒ Float
The to_mm method is used to convert from inches to millimeters.
222 223 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 222 def to_mm end |
#to_yard ⇒ Float
The to_yard method is used to convert from inches to yards.
234 235 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 234 def to_yard end |
#yard ⇒ Length
The yard method is used to convert from yards to inches.
246 247 |
# File 'lib/sketchup-api-stubs/stubs/numeric.rb', line 246 def yard end |