Method: Joules.current_v1
- Defined in:
- lib/joules/electricity.rb
.current_v1(charge, time) ⇒ Float
Note:
There is one other method for calculating current.
Calculates the current given charge and time.
27 28 29 30 31 32 33 |
# File 'lib/joules/electricity.rb', line 27 def current_v1(charge, time) if time.zero? raise ZeroDivisionError.new('divided by 0') else return charge / time.to_f end end |