diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-05 10:05:11 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-05-05 10:05:11 +0000 |
commit | b65e3629dad9fba8f37202d3dc0103d9d08c1396 (patch) | |
tree | a1f72cf510d0c0ef6e9c558fd0dde97aaf05e5fe /lib/date.rb | |
parent | 79f7c2b1b69fa8eb3d6aae5c881c9ac3015001fb (diff) |
* sample/test.rb: substitute 'select' with 'values_at'.
* lib/date.rb: ditto.
* lib/parsedate.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date.rb')
-rw-r--r-- | lib/date.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/date.rb b/lib/date.rb index e04f0b01b0..b3641516cf 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -218,7 +218,7 @@ class Date def self.new_with_hash(elem, sg) elem ||= {} - y, m, d = elem.select(:year, :mon, :mday) + y, m, d = elem.values_at(:year, :mon, :mday) if [y, m, d].include? nil raise ArgumentError, 'invalid date' else @@ -476,7 +476,7 @@ class DateTime < Date def self.new_with_hash(elem, sg) elem ||= {} y, m, d, h, min, s, of = - elem.select(:year, :mon, :mday, :hour, :min, :sec, :offset) + elem.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset) h ||= 0 min ||= 0 s ||= 0 |