Class: Calcpace

Inherits:
Object
  • Object
show all
Includes:
Calculator, Checker, Converter
Defined in:
lib/calcpace.rb

Overview

Main class to calculate velocity, time, distance and velocity

Constant Summary

Constants included from Converter

Converter::FEET_S_TO_M_S, Converter::FEET_TO_METERS, Converter::INCHES_TO_METERS, Converter::KM_H_TO_MI_H, Converter::KM_H_TO_M_S, Converter::KM_TO_METERS, Converter::KM_TO_MI, Converter::KM_TO_NAUTICAL_MI, Converter::KNOTS_TO_M_S, Converter::METERS_TO_FEET, Converter::METERS_TO_INCHES, Converter::METERS_TO_KM, Converter::METERS_TO_MI, Converter::METERS_TO_YARDS, Converter::MI_H_TO_KM_H, Converter::MI_H_TO_M_S, Converter::MI_TO_KM, Converter::MI_TO_METERS, Converter::M_S_TO_FEET_S, Converter::M_S_TO_KM_H, Converter::M_S_TO_KNOTS, Converter::M_S_TO_MI_H, Converter::M_S_TO_NAUTICAL_MI_H, Converter::NAUTICAL_MI_H_TO_M_S, Converter::NAUTICAL_MI_TO_KM, Converter::YARDS_TO_METERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Converter

#constant, #convert, #convert_to_bigdecimal, #convert_to_clocktime, #convert_to_seconds, #list_constants

Methods included from Checker

#check_positive, #check_time

Methods included from Calculator

#checked_distance, #checked_time, #checked_velocity, #clock_time, #clock_velocity, #distance, #time, #velocity

Constructor Details

#initialize(bigdecimal = false) ⇒ Calcpace

Returns a new instance of Calcpace.



15
16
17
# File 'lib/calcpace.rb', line 15

def initialize(bigdecimal = false)
  @bigdecimal = bigdecimal
end

Instance Attribute Details

#bigdecimalObject (readonly)

Returns the value of attribute bigdecimal.



13
14
15
# File 'lib/calcpace.rb', line 13

def bigdecimal
  @bigdecimal
end