Issue #17022 has been reported by americodls (Americo Duarte).

----------------------------------------
Feature #17022: Addition of method Kernel#Date
https://bugs.ruby-lang.org/issues/17022

* Author: americodls (Americo Duarte)
* Status: Open
* Priority: Normal
----------------------------------------
What if we have a method `Kernel#Date` that delegates to `Date.parse`?

Dates could be written in a more natural way, right?

```ruby
Date("2020-01-13") - Date("2019-01-13")
```

Another capitalized methods are added to the Kernel module to facilitate construction of another basic types:


``` ruby
Kernel.methods.grep(/^[A-Z].*/)
#=> [:Rational, :Complex, :URI, :Integer, :Float, :String, :Array, :Hash, :Pathname]
```

`BigDecimal` is added too when is required:

```ruby
require 'bigdecimal'
Kernel.methods.grep(/^[A-Z].*/)
#=> [:Rational, :Complex, :BigDecimal, :URI, :Integer, :Float, :String, :Array, :Hash, :Pathname]
```

So the proposal is do the same was done with BigDecimal, when we do `require 'date'` a method `Kernel#Date` should be added as well.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>