/** int_downto * */ // TODO: Make callCoerced work in block context...then fix downto, step, and upto. @JRubyMethod public IRubyObject downto(ThreadContext context, IRubyObject to, Block block) { if (block.isGiven()) { if (this instanceof RubyFixnum && to instanceof RubyFixnum) { fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); } else { duckDownto(context, this, to, block); } return this; } else { return enumeratorize(context.runtime, this, "downto", to); } }
/** int_downto * */ // TODO: Make callCoerced work in block context...then fix downto, step, and upto. @JRubyMethod public IRubyObject downto(ThreadContext context, IRubyObject to, Block block) { if (block.isGiven()) { if (this instanceof RubyFixnum && to instanceof RubyFixnum) { fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); } else { duckDownto(context, this, to, block); } return this; } else { return enumeratorize(context.runtime, this, "downto", to); } }
/** int_downto * */ // TODO: Make callCoerced work in block context...then fix downto, step, and upto. @JRubyMethod public IRubyObject downto(ThreadContext context, IRubyObject to, Block block) { if (block.isGiven()) { if (this instanceof RubyFixnum && to instanceof RubyFixnum) { fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); } else { duckDownto(context, this, to, block); } return this; } else { return enumeratorizeWithSize(context, this, "downto", new IRubyObject[] { to }, downToSize(context, this, to)); } }
/** int_downto * */ // TODO: Make callCoerced work in block context...then fix downto, step, and upto. @JRubyMethod public IRubyObject downto(ThreadContext context, IRubyObject to, Block block) { if (block.isGiven()) { if (this instanceof RubyFixnum && to instanceof RubyFixnum) { fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); } else { duckDownto(context, this, to, block); } return this; } else { return enumeratorizeWithSize(context, this, "downto", new IRubyObject[] { to }, downToSize(context, this, to)); } }