HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-3.0.2/spec/ruby/core/random/fixtures/classes.rb
module RandomSpecs
  CustomRangeInteger = Struct.new(:value) do
    def to_int; value; end
    def <=>(other); to_int <=> other.to_int; end
    def -(other); self.class.new(to_int - other.to_int); end
    def +(other); self.class.new(to_int + other.to_int); end
  end

  CustomRangeFloat = Struct.new(:value) do
    def to_f; value; end
    def <=>(other); to_f <=> other.to_f; end
    def -(other); to_f - other.to_f; end
    def +(other); self.class.new(to_f + other.to_f); end
  end
end