W3cubDocs

/Ruby on Rails 5.1

class Rational

Parent:
Object

Public Instance Methods

duplicable?() Show source

Rationals are not duplicable for RUBY_VERSION < 2.5.0:

Rational(1).duplicable? # => false Rational(1).dup # => TypeError: can't copy Rational

# File activesupport/lib/active_support/core_ext/object/duplicable.rb, line 150
def duplicable?
  false
end

© 2004–2017 David Heinemeier Hansson
Licensed under the MIT License.