123456789_123456789_123456789_123456789_123456789_

Class: Gem::SafeMarshal::Visitors::ToRuby::RationalCompat

Relationships & Source Files
Inherits: Object
Defined in: lib/rubygems/safe_marshal/visitors/to_ruby.rb

Instance Method Summary

Instance Method Details

#marshal_load(s)

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'lib/rubygems/safe_marshal/visitors/to_ruby.rb', line 288

def marshal_load(s)
  num, den = s
  raise ArgumentError, "Expected 2 ints" unless s.size == 2 && num.is_a?(Integer) && den.is_a?(Integer)
  Rational(num, den)
end