Module: ActiveObject::Numeric
- Defined in:
- lib/active_object/numeric.rb
Instance Method Summary collapse
- #add(num) ⇒ Object
- #bytes_in_bytes ⇒ Object (also: #byte_in_bytes)
- #centigrams_in_grams ⇒ Object (also: #centigram_in_grams)
- #centimeters_in_meters ⇒ Object (also: #centimeter_in_meters)
- #centuries_in_seconds ⇒ Object (also: #century_in_seconds)
-
#clamp(minimum, maximum = nil) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity.
-
#days_in_seconds ⇒ Object
(also: #day_in_seconds)
rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity.
- #decades_in_seconds ⇒ Object (also: #decade_in_seconds)
- #decagrams_in_grams ⇒ Object (also: #decagram_in_grams)
- #decameters_in_meters ⇒ Object (also: #decameter_in_meters)
- #decigrams_in_grams ⇒ Object (also: #decigram_in_grams)
- #decimeters_in_meters ⇒ Object (also: #decimeter_in_meters)
- #decrement(amount = 1.0) ⇒ Object
- #degrees_to_radians ⇒ Object (also: #degree_to_radians)
- #distance(num) ⇒ Object
- #divide(num) ⇒ Object
- #exabytes_in_bytes ⇒ Object (also: #exabyte_in_bytes)
- #feet_in_inches ⇒ Object (also: #foot_in_inches)
- #gigabytes_in_bytes ⇒ Object (also: #gigabyte_in_bytes)
- #grams_in_grams ⇒ Object (also: #gram_in_grams)
- #greater_than?(num) ⇒ Boolean
- #greater_than_or_equal_to?(num) ⇒ Boolean
- #hectograms_in_grams ⇒ Object (also: #hectogram_in_grams)
- #hectometers_in_meters ⇒ Object (also: #hectometer_in_meters)
- #hours_in_seconds ⇒ Object (also: #hour_in_seconds)
- #inches_in_inches ⇒ Object (also: #inch_in_inches)
- #increment(amount = 1.0) ⇒ Object
- #inside?(start, finish) ⇒ Boolean
- #kilobytes_in_bytes ⇒ Object (also: #kilobyte_in_bytes)
- #kilograms_in_grams ⇒ Object (also: #kilogram_in_grams)
- #kilometers_in_meters ⇒ Object (also: #kilometer_in_meters)
- #less_than?(num) ⇒ Boolean
- #less_than_or_equal_to?(num) ⇒ Boolean
- #megabytes_in_bytes ⇒ Object (also: #megabyte_in_bytes)
- #meters_in_meters ⇒ Object (also: #meter_in_meters)
- #metric_tons_in_grams ⇒ Object (also: #metric_ton_in_grams)
- #miles_in_inches ⇒ Object (also: #mile_in_inches)
- #millenniums_in_seconds ⇒ Object (also: #millennium_in_seconds)
- #milligrams_in_grams ⇒ Object (also: #milligram_in_grams)
- #millimeters_in_meters ⇒ Object (also: #millimeter_in_meters)
- #minutes_in_seconds ⇒ Object (also: #minute_in_seconds)
- #multiple_of?(number) ⇒ Boolean
- #multiply(num) ⇒ Object
- #nautical_miles_in_inches ⇒ Object (also: #nautical_mile_in_inches)
-
#negative? ⇒ Boolean
rubocop:disable Style/NumericPredicate, Style/YodaCondition.
-
#ordinal ⇒ Object
rubocop:enable Style/NumericPredicate, Style/YodaCondition.
- #ordinalize ⇒ Object
- #ounces_in_ounces ⇒ Object (also: #ounce_in_ounces)
- #outside?(start, finish) ⇒ Boolean
- #pad(options = {}) ⇒ Object
-
#pad_precision(options = {}) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity.
-
#percentage_of(number) ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity.
- #petabytes_in_bytes ⇒ Object (also: #petabyte_in_bytes)
-
#positive? ⇒ Boolean
rubocop:disable Style/NumericPredicate, Style/YodaCondition.
-
#pounds_in_ounces ⇒ Object
(also: #pound_in_ounces)
rubocop:enable Style/NumericPredicate, Style/YodaCondition.
- #power(num) ⇒ Object
- #root(num) ⇒ Object
- #seconds_in_seconds ⇒ Object (also: #second_in_seconds)
- #stones_in_ounces ⇒ Object (also: #stone_in_ounces)
- #subtract(num) ⇒ Object
- #terabytes_in_bytes ⇒ Object (also: #terabyte_in_bytes)
- #to_byte(from, to) ⇒ Object
- #to_currency(options = {}) ⇒ Object
-
#to_length(from, to) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/MethodLength.
-
#to_mass(from, to) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/MethodLength.
-
#to_nearest_value(values = []) ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/MethodLength.
- #to_percentage(options = {}) ⇒ Object
-
#to_temperature(from, to) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity.
-
#to_time(from, to) ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity.
- #tons_in_ounces ⇒ Object (also: #ton_in_ounces)
- #weeks_in_seconds ⇒ Object (also: #week_in_seconds)
- #within?(number, epsilon = 0.01) ⇒ Boolean
- #yards_in_inches ⇒ Object (also: #yard_in_inches)
- #years_in_seconds ⇒ Object (also: #year_in_seconds)
Instance Method Details
#add(num) ⇒ Object
55 56 57 |
# File 'lib/active_object/numeric.rb', line 55 def add(num) self + num end |
#bytes_in_bytes ⇒ Object Also known as: byte_in_bytes
59 60 61 |
# File 'lib/active_object/numeric.rb', line 59 def bytes_in_bytes self end |
#centigrams_in_grams ⇒ Object Also known as: centigram_in_grams
65 66 67 |
# File 'lib/active_object/numeric.rb', line 65 def centigrams_in_grams self * CENTI end |
#centimeters_in_meters ⇒ Object Also known as: centimeter_in_meters
71 72 73 |
# File 'lib/active_object/numeric.rb', line 71 def centimeters_in_meters self * CENTI end |
#centuries_in_seconds ⇒ Object Also known as: century_in_seconds
77 78 79 |
# File 'lib/active_object/numeric.rb', line 77 def centuries_in_seconds self * CENTURY end |
#clamp(minimum, maximum = nil) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/active_object/numeric.rb', line 84 def clamp(minimum, maximum = nil) if maximum.nil? && minimum.is_a?(Range) min_min = minimum.min min_max = minimum.max return min_min if min_min > self min_max < self ? min_max : self else return minimum if minimum > self maximum < self ? maximum : self end end |
#days_in_seconds ⇒ Object Also known as: day_in_seconds
rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
100 101 102 |
# File 'lib/active_object/numeric.rb', line 100 def days_in_seconds self * DAY end |
#decades_in_seconds ⇒ Object Also known as: decade_in_seconds
106 107 108 |
# File 'lib/active_object/numeric.rb', line 106 def decades_in_seconds self * DECADE end |
#decagrams_in_grams ⇒ Object Also known as: decagram_in_grams
112 113 114 |
# File 'lib/active_object/numeric.rb', line 112 def decagrams_in_grams self * DECA end |
#decameters_in_meters ⇒ Object Also known as: decameter_in_meters
118 119 120 |
# File 'lib/active_object/numeric.rb', line 118 def decameters_in_meters self * DECA end |
#decigrams_in_grams ⇒ Object Also known as: decigram_in_grams
124 125 126 |
# File 'lib/active_object/numeric.rb', line 124 def decigrams_in_grams self * DECI end |
#decimeters_in_meters ⇒ Object Also known as: decimeter_in_meters
130 131 132 |
# File 'lib/active_object/numeric.rb', line 130 def decimeters_in_meters self * DECI end |
#decrement(amount = 1.0) ⇒ Object
136 137 138 |
# File 'lib/active_object/numeric.rb', line 136 def decrement(amount = 1.0) self + amount end |
#degrees_to_radians ⇒ Object Also known as: degree_to_radians
140 141 142 |
# File 'lib/active_object/numeric.rb', line 140 def degrees_to_radians self * Math::PI / 180.0 end |
#distance(num) ⇒ Object
146 147 148 |
# File 'lib/active_object/numeric.rb', line 146 def distance(num) (self - num).abs end |
#divide(num) ⇒ Object
150 151 152 |
# File 'lib/active_object/numeric.rb', line 150 def divide(num) self / num end |
#exabytes_in_bytes ⇒ Object Also known as: exabyte_in_bytes
154 155 156 |
# File 'lib/active_object/numeric.rb', line 154 def exabytes_in_bytes self * EXABYTE end |
#feet_in_inches ⇒ Object Also known as: foot_in_inches
160 161 162 |
# File 'lib/active_object/numeric.rb', line 160 def feet_in_inches self * FEET end |
#gigabytes_in_bytes ⇒ Object Also known as: gigabyte_in_bytes
166 167 168 |
# File 'lib/active_object/numeric.rb', line 166 def gigabytes_in_bytes self * GIGABYTE end |
#grams_in_grams ⇒ Object Also known as: gram_in_grams
172 173 174 |
# File 'lib/active_object/numeric.rb', line 172 def grams_in_grams self end |
#greater_than?(num) ⇒ Boolean
178 179 180 |
# File 'lib/active_object/numeric.rb', line 178 def greater_than?(num) num < self end |
#greater_than_or_equal_to?(num) ⇒ Boolean
182 183 184 |
# File 'lib/active_object/numeric.rb', line 182 def greater_than_or_equal_to?(num) num <= self end |
#hectograms_in_grams ⇒ Object Also known as: hectogram_in_grams
186 187 188 |
# File 'lib/active_object/numeric.rb', line 186 def hectograms_in_grams self * HECTO end |
#hectometers_in_meters ⇒ Object Also known as: hectometer_in_meters
192 193 194 |
# File 'lib/active_object/numeric.rb', line 192 def hectometers_in_meters self * HECTO end |
#hours_in_seconds ⇒ Object Also known as: hour_in_seconds
198 199 200 |
# File 'lib/active_object/numeric.rb', line 198 def hours_in_seconds self * HOUR end |
#inches_in_inches ⇒ Object Also known as: inch_in_inches
204 205 206 |
# File 'lib/active_object/numeric.rb', line 204 def inches_in_inches self end |
#increment(amount = 1.0) ⇒ Object
210 211 212 |
# File 'lib/active_object/numeric.rb', line 210 def increment(amount = 1.0) self + amount end |
#inside?(start, finish) ⇒ Boolean
214 215 216 |
# File 'lib/active_object/numeric.rb', line 214 def inside?(start, finish) (start < self) && (finish > self) end |
#kilobytes_in_bytes ⇒ Object Also known as: kilobyte_in_bytes
218 219 220 |
# File 'lib/active_object/numeric.rb', line 218 def kilobytes_in_bytes self * KILOBYTE end |
#kilograms_in_grams ⇒ Object Also known as: kilogram_in_grams
230 231 232 |
# File 'lib/active_object/numeric.rb', line 230 def kilograms_in_grams self * KILO end |
#kilometers_in_meters ⇒ Object Also known as: kilometer_in_meters
224 225 226 |
# File 'lib/active_object/numeric.rb', line 224 def kilometers_in_meters self * KILO end |
#less_than?(num) ⇒ Boolean
236 237 238 |
# File 'lib/active_object/numeric.rb', line 236 def less_than?(num) num > self end |
#less_than_or_equal_to?(num) ⇒ Boolean
240 241 242 |
# File 'lib/active_object/numeric.rb', line 240 def less_than_or_equal_to?(num) num >= self end |
#megabytes_in_bytes ⇒ Object Also known as: megabyte_in_bytes
250 251 252 |
# File 'lib/active_object/numeric.rb', line 250 def megabytes_in_bytes self * MEGABYTE end |
#meters_in_meters ⇒ Object Also known as: meter_in_meters
256 257 258 |
# File 'lib/active_object/numeric.rb', line 256 def meters_in_meters self end |
#metric_tons_in_grams ⇒ Object Also known as: metric_ton_in_grams
244 245 246 |
# File 'lib/active_object/numeric.rb', line 244 def metric_tons_in_grams self * METRIC_TON end |
#miles_in_inches ⇒ Object Also known as: mile_in_inches
262 263 264 |
# File 'lib/active_object/numeric.rb', line 262 def miles_in_inches self * MILE end |
#millenniums_in_seconds ⇒ Object Also known as: millennium_in_seconds
268 269 270 |
# File 'lib/active_object/numeric.rb', line 268 def millenniums_in_seconds self * MILLENNIUM end |
#milligrams_in_grams ⇒ Object Also known as: milligram_in_grams
274 275 276 |
# File 'lib/active_object/numeric.rb', line 274 def milligrams_in_grams self * MILLI end |
#millimeters_in_meters ⇒ Object Also known as: millimeter_in_meters
280 281 282 |
# File 'lib/active_object/numeric.rb', line 280 def millimeters_in_meters self * MILLI end |
#minutes_in_seconds ⇒ Object Also known as: minute_in_seconds
286 287 288 |
# File 'lib/active_object/numeric.rb', line 286 def minutes_in_seconds self * MINUTE end |
#multiple_of?(number) ⇒ Boolean
296 297 298 |
# File 'lib/active_object/numeric.rb', line 296 def multiple_of?(number) number.zero? ? zero? : modulo(number).zero? end |
#multiply(num) ⇒ Object
292 293 294 |
# File 'lib/active_object/numeric.rb', line 292 def multiply(num) self * num end |
#nautical_miles_in_inches ⇒ Object Also known as: nautical_mile_in_inches
300 301 302 |
# File 'lib/active_object/numeric.rb', line 300 def nautical_miles_in_inches self * NAUTICAL_MILE end |
#negative? ⇒ Boolean
rubocop:disable Style/NumericPredicate, Style/YodaCondition
307 308 309 |
# File 'lib/active_object/numeric.rb', line 307 def negative? 0 > self end |
#ordinal ⇒ Object
rubocop:enable Style/NumericPredicate, Style/YodaCondition
312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/active_object/numeric.rb', line 312 def ordinal if (11..13).cover?(abs % 100) 'th' else case abs % 10 when 1 then 'st' when 2 then 'nd' when 3 then 'rd' else 'th' end end end |
#ordinalize ⇒ Object
325 326 327 |
# File 'lib/active_object/numeric.rb', line 325 def ordinalize "#{self}#{ordinal}" end |
#ounces_in_ounces ⇒ Object Also known as: ounce_in_ounces
329 330 331 |
# File 'lib/active_object/numeric.rb', line 329 def ounces_in_ounces self end |
#outside?(start, finish) ⇒ Boolean
335 336 337 |
# File 'lib/active_object/numeric.rb', line 335 def outside?(start, finish) (start > self) || (finish < self) end |
#pad(options = {}) ⇒ Object
339 340 341 342 343 344 |
# File 'lib/active_object/numeric.rb', line 339 def pad( = {}) pad_number = [:pad_number] || 0 precision = [:precision] || 3 to_s.rjust(precision, pad_number.to_s) end |
#pad_precision(options = {}) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/active_object/numeric.rb', line 348 def pad_precision( = {}) pad_number = [:pad_number] || 0 precision = [:precision] || 2 separator = [:separator] || '.' string = to_s string << separator unless string.include?(separator) ljust_count = string.split(separator).first.length ljust_count += (string.count(separator) + precision) if precision.positive? if ljust_count >= string.length string.ljust(ljust_count, pad_number.to_s) else string[0..(ljust_count - 1)] end end |
#percentage_of(number) ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
367 368 369 370 |
# File 'lib/active_object/numeric.rb', line 367 def percentage_of(number) return 0 if zero? || number.zero? (to_f / number.to_f) * 100.0 end |
#petabytes_in_bytes ⇒ Object Also known as: petabyte_in_bytes
372 373 374 |
# File 'lib/active_object/numeric.rb', line 372 def petabytes_in_bytes self * PETABYTE end |
#positive? ⇒ Boolean
rubocop:disable Style/NumericPredicate, Style/YodaCondition
379 380 381 |
# File 'lib/active_object/numeric.rb', line 379 def positive? 0 < self end |
#pounds_in_ounces ⇒ Object Also known as: pound_in_ounces
rubocop:enable Style/NumericPredicate, Style/YodaCondition
384 385 386 |
# File 'lib/active_object/numeric.rb', line 384 def pounds_in_ounces self * POUND end |
#power(num) ⇒ Object
390 391 392 |
# File 'lib/active_object/numeric.rb', line 390 def power(num) self**num end |
#root(num) ⇒ Object
394 395 396 |
# File 'lib/active_object/numeric.rb', line 394 def root(num) self**(1.0 / num) end |
#seconds_in_seconds ⇒ Object Also known as: second_in_seconds
398 399 400 |
# File 'lib/active_object/numeric.rb', line 398 def seconds_in_seconds self end |
#stones_in_ounces ⇒ Object Also known as: stone_in_ounces
404 405 406 |
# File 'lib/active_object/numeric.rb', line 404 def stones_in_ounces self * STONE end |
#subtract(num) ⇒ Object
410 411 412 |
# File 'lib/active_object/numeric.rb', line 410 def subtract(num) self - num end |
#terabytes_in_bytes ⇒ Object Also known as: terabyte_in_bytes
414 415 416 |
# File 'lib/active_object/numeric.rb', line 414 def terabytes_in_bytes self * TERABYTE end |
#to_byte(from, to) ⇒ Object
420 421 422 423 |
# File 'lib/active_object/numeric.rb', line 420 def to_byte(from, to) assert_inclusion_of_valid_keys!(BYTE_KEYS, from, to) to_f * 1.send("#{from}_in_bytes").to_f / 1.send("#{to}_in_bytes").to_f end |
#to_currency(options = {}) ⇒ Object
425 426 427 428 429 |
# File 'lib/active_object/numeric.rb', line 425 def to_currency( = {}) unit = [:unit] || '$' "#{unit}#{pad_precision(.only(:precision))}" end |
#to_length(from, to) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/MethodLength
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/active_object/numeric.rb', line 432 def to_length(from, to) assert_inclusion_of_valid_keys!(LENGTH_KEYS.values.flatten, from, to) metric_keys = LENGTH_KEYS.fetch(:metric) return self if from == to metrics_included_from = metric_keys.include?(from) case to when :meter, :meters, :millimeter, :millimeters, :centimeter, :centimeters, :decimeter, :decimeters, :decameter, :decameters, :hectometer, :hectometers, :kilometer, :kilometers if metrics_included_from to_f * 1.send("#{from}_in_meters").to_f / 1.send("#{to}_in_meters").to_f else to_f * ((1.send("#{from}_in_inches").to_f * 0.0254) / 1.send("#{to}_in_meters").to_f) end when :inch, :inches, :foot, :feet, :yard, :yards, :mile, :miles, :nautical_mile, :nautical_miles if metrics_included_from to_f * ((1.send("#{from}_in_meters").to_f * 39.3701) / 1.send("#{to}_in_inches").to_f) else to_f * 1.send("#{from}_in_inches").to_f / 1.send("#{to}_in_inches").to_f end end end |
#to_mass(from, to) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/MethodLength
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/active_object/numeric.rb', line 457 def to_mass(from, to) assert_inclusion_of_valid_keys!(MASS_KEYS.values.flatten, from, to) metric_keys = MASS_KEYS.fetch(:metric) return self if from == to metrics_included_from = metric_keys.include?(from) case to when :gram, :grams, :milligram, :milligrams, :centigram, :centigrams, :decigram, :decigrams, :decagram, :decagrams, :hectogram, :hectograms, :kilogram, :kilograms, :metric_ton, :metric_tons if metrics_included_from to_f * 1.send("#{from}_in_grams").to_f / 1.send("#{to}_in_grams").to_f else to_f * ((1.send("#{from}_in_ounces") * 28.3495).to_f / 1.send("#{to}_in_grams").to_f) end when :ounce, :ounces, :pound, :pounds, :stone, :stones, :ton, :tons if metrics_included_from to_f * ((1.send("#{from}_in_grams") * 0.035274).to_f / 1.send("#{to}_in_ounces").to_f) else to_f * 1.send("#{from}_in_ounces").to_f / 1.send("#{to}_in_ounces").to_f end end end |
#to_nearest_value(values = []) ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/MethodLength
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/active_object/numeric.rb', line 482 def to_nearest_value(values = []) return self if values.length.zero? value = values.first difference = (self - value).abs values.each do |val| if (self - val).abs < difference difference = (self - val).abs value = val end end value end |
#to_percentage(options = {}) ⇒ Object
498 499 500 501 502 |
# File 'lib/active_object/numeric.rb', line 498 def to_percentage( = {}) unit = [:unit] || '%' "#{pad_precision(.only(:precision))}#{unit}" end |
#to_temperature(from, to) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/active_object/numeric.rb', line 505 def to_temperature(from, to) assert_inclusion_of_valid_keys!(TEMPERATURE_KEYS, from, to) return self if from == to case to when :celsius from == :kelvin ? (self - 273.15) : ((self - 32.0) * 5.0 / 9.0) when :fahrenheit from == :kelvin ? (1.8 * (self - 273.15) + 32.0) : ((self * 9.0 / 5.0) + 32.0) when :kelvin from == :celsius ? (self + 273.15) : (((self - 32.0) * 5.0 / 9.0) + 273.15) end end |
#to_time(from, to) ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
520 521 522 523 |
# File 'lib/active_object/numeric.rb', line 520 def to_time(from, to) assert_inclusion_of_valid_keys!(TIME_KEYS, from, to) (to_f * 1.send("#{from}_in_seconds").to_f) / 1.send("#{to}_in_seconds").to_f end |
#tons_in_ounces ⇒ Object Also known as: ton_in_ounces
525 526 527 |
# File 'lib/active_object/numeric.rb', line 525 def tons_in_ounces self * TON end |
#weeks_in_seconds ⇒ Object Also known as: week_in_seconds
531 532 533 |
# File 'lib/active_object/numeric.rb', line 531 def weeks_in_seconds self * WEEK end |
#within?(number, epsilon = 0.01) ⇒ Boolean
537 538 539 540 541 542 543 544 |
# File 'lib/active_object/numeric.rb', line 537 def within?(number, epsilon = 0.01) return number == self if epsilon.zero? alpha = to_f beta = number.to_f alpha.zero? || beta.zero? ? (alpha - beta).abs < epsilon : (alpha / beta - 1).abs < epsilon end |
#yards_in_inches ⇒ Object Also known as: yard_in_inches
546 547 548 |
# File 'lib/active_object/numeric.rb', line 546 def yards_in_inches self * YARD end |
#years_in_seconds ⇒ Object Also known as: year_in_seconds
552 553 554 |
# File 'lib/active_object/numeric.rb', line 552 def years_in_seconds self * YEAR end |