Class: RoundedTime

Inherits:
Object
  • Object
show all
Defined in:
lib/rounded_time.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time) ⇒ RoundedTime

Returns a new instance of RoundedTime.


7
8
9
# File 'lib/rounded_time.rb', line 7

def initialize(time)
  @time = time
end

Class Method Details

.nowObject


3
4
5
# File 'lib/rounded_time.rb', line 3

def self.now
  new(Time.now).time
end

Instance Method Details

#timeObject


11
12
13
14
15
# File 'lib/rounded_time.rb', line 11

def time
  send Punch.config.punch_now_rounder
rescue NoMethodError
  fair
end