Exemple #1
0
  @JRubyMethod(name = "<", required = 1)
  public IRubyObject op_lt(ThreadContext context, IRubyObject other) {
    if (other instanceof RubyTime) {
      return getRuntime().newBoolean(cmp((RubyTime) other) < 0);
    }

    return RubyComparable.op_lt(context, this, other);
  }
Exemple #2
0
  @JRubyMethod(name = "==", required = 1, compat = CompatVersion.RUBY1_9)
  public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
    if (other.isNil()) {
      return RubyBoolean.newBoolean(getRuntime(), false);
    } else if (other instanceof RubyTime) {
      return getRuntime().newBoolean(cmp((RubyTime) other) == 0);
    }

    return RubyComparable.op_equal(context, this, other);
  }