[ruby-cvs:69767] mrkn:r62598 (trunk): Support two `to_r`-responding args in Rational()

mrkn at ruby-lang.org mrkn at ruby-lang.org
Wed Feb 28 01:45:10 JST 2018


mrkn	2018-02-28 01:45:09 +0900 (Wed, 28 Feb 2018)

  New Revision: 62598

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62598

  Log:
    Support two `to_r`-responding args in Rational()
    
    * rational.c (nurat_s_convert): call `to_r` to convert non-Numeric
      objects also if argc == 2 in Rational().
    
    * test/ruby/test_rational.rb: add tests.

  Modified files:
    trunk/rational.c
    trunk/test/ruby/test_rational.rb


More information about the ruby-cvs mailing list