Refine search
@JRubyMethod(name = "lineno=", required = 1) public IRubyObject set_lineno(ThreadContext context, IRubyObject arg) { ptr.lineno = RubyNumeric.fix2int(arg); return context.nil; }
@JRubyMethod public IRubyObject iconv(IRubyObject str, IRubyObject startArg, IRubyObject endArg) { int start = 0; int end = -1; if (!startArg.isNil()) start = RubyNumeric.fix2int(startArg); if (!endArg.isNil()) end = RubyNumeric.fix2int(endArg); return iconv(str, start, end); }
@JRubyMethod(name = "pos=", required = 1) public IRubyObject set_pos(IRubyObject newPos) { int pos2 = RubyNumeric.fix2int(newPos); if (pos2 >= 0) this.pos = pos2; return newPos; }
@JRubyMethod public IRubyObject iconv(IRubyObject str, IRubyObject startArg, IRubyObject endArg) { int start = 0; int end = -1; if (!startArg.isNil()) start = RubyNumeric.fix2int(startArg); if (!endArg.isNil()) end = RubyNumeric.fix2int(endArg); return iconv(str, start, end); }
@JRubyMethod(name = "lineno=", required = 1) public IRubyObject set_lineno(IRubyObject lineArg) { line = RubyNumeric.fix2int(lineArg); return lineArg; }
@JRubyMethod(name = "flush", optional = 1) public IRubyObject flush(IRubyObject[] args) { int flush = 2; // SYNC_FLUSH if (args.length == 1 && !args[0].isNil()) flush = RubyNumeric.fix2int(args[0]); return flush(flush); }
@JRubyMethod(name = "pos=", required = 1) public IRubyObject set_pos(IRubyObject newPos) { int pos2 = RubyNumeric.fix2int(newPos); if (pos2 >= 0) this.pos = pos2; return newPos; }
@JRubyMethod(name = "flush", optional = 1) public IRubyObject flush(IRubyObject[] args) { int flush = 2; // SYNC_FLUSH if (args.length == 1 && !args[0].isNil()) flush = RubyNumeric.fix2int(args[0]); return flush(flush); }
public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject port, IRubyObject host) { int portNum = port instanceof RubyString ? Integer.parseInt(port.convertToString().toString()) : RubyNumeric.fix2int(port); return Sockaddr.pack_sockaddr_in( context, portNum, host.isNil() ? null : host.convertToString().toString()); }
@JRubyMethod(name = "lineno=", required = 1) public IRubyObject set_lineno(IRubyObject lineArg) { line = RubyNumeric.fix2int(lineArg); return lineArg; }
@JRubyMethod public IRubyObject iconv(IRubyObject str, IRubyObject startArg) { int start = 0; if (!startArg.isNil()) start = RubyNumeric.fix2int(startArg); return iconv(str, start, -1); }
/** rb_cmpint * */ public static int cmpint(ThreadContext context, IRubyObject val, IRubyObject a, IRubyObject b) { if (val.isNil()) cmperr(a, b); if (val instanceof RubyFixnum) return RubyNumeric.fix2int((RubyFixnum) val); if (val instanceof RubyBignum) return ((RubyBignum) val).getValue().signum() == -1 ? -1 : 1; RubyFixnum zero = RubyFixnum.zero(context.runtime); if (val.callMethod(context, ">", zero).isTrue()) return 1; if (val.callMethod(context, "<", zero).isTrue()) return -1; return 0; }
@JRubyMethod(name = "lineno=", required = 1) public IRubyObject set_lineno(IRubyObject lineArg) { line = RubyNumeric.fix2int(lineArg); return lineArg; }
@JRubyMethod(name = "flush", optional = 1) public IRubyObject flush(IRubyObject[] args) { int flush = 2; // SYNC_FLUSH if (args.length == 1 && !args[0].isNil()) flush = RubyNumeric.fix2int(args[0]); return flush(flush); }
/** rb_cmpint * */ public static int cmpint(ThreadContext context, IRubyObject val, IRubyObject a, IRubyObject b) { if (val.isNil()) cmperr(a, b); if (val instanceof RubyFixnum) return RubyNumeric.fix2int((RubyFixnum) val); if (val instanceof RubyBignum) return ((RubyBignum) val).getValue().signum() == -1 ? -1 : 1; RubyFixnum zero = RubyFixnum.zero(context.runtime); if (val.callMethod(context, ">", zero).isTrue()) return 1; if (val.callMethod(context, "<", zero).isTrue()) return -1; return 0; }
@JRubyMethod(name = "pos=", required = 1) public IRubyObject set_pos(IRubyObject newPos) { int pos2 = RubyNumeric.fix2int(newPos); if (pos2 >= 0) this.pos = pos2; return newPos; }
@JRubyMethod(name = "flush", optional = 1) public IRubyObject flush(IRubyObject[] args) { int flush = 2; // SYNC_FLUSH if (args.length == 1 && !args[0].isNil()) flush = RubyNumeric.fix2int(args[0]); return flush(flush); }