nearest 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/nearest.rb +2 -1
  2. metadata +1 -1
data/lib/nearest.rb CHANGED
@@ -2,6 +2,7 @@ class Time
2
2
  def nearest(seconds, opts={})
3
3
  method = opts[:force] ? (opts[:force] == :future ? 'ceil' : 'floor') : 'round'
4
4
 
5
- Time.at((self.to_f / seconds).send(method) * seconds)
5
+ new_time = Time.at((self.to_f / seconds).send(method) * seconds)
6
+ utc? ? new_time.utc : new_time
6
7
  end
7
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nearest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: