class NthPrime
Attributes
calculation_time[RW]
nth_prime[RW]
Public Class Methods
new()
click to toggle source
# File lib/nth_prime.rb, line 7 def initialize() p = Prime.new() puts "Which nth prime number you want to get ? :" nth = gets start_time = Time.now @nth_prime = p.get_nth_prime(nth.to_i) end_time = Time.now @calculation_time = end_time - start_time return self end