Exemple #1
0
  // @RubyLevelMethod(name="&")
  public RubyArray and(RubyValue value) {
    RubyArray other = value.toAry();

    RubyArray a = new RubyArray();
    //        for (RubyValue v : array_) {
    for (Iterator iter = array_.iterator(); iter.hasNext(); ) {
      RubyValue v = (RubyValue) iter.next();
      if (other.include(v) == RubyConstant.QTRUE && a.include(v) == RubyConstant.QFALSE) {
        a.add(v);
      }
    }
    return a;
  }
Exemple #2
0
 // @RubyLevelMethod(name="-")
 public RubyArray minus(RubyValue v) {
   return this.minus(v.toAry());
 }
Exemple #3
0
 // @RubyLevelMethod(name="concat")
 public RubyArray concat(RubyValue v) {
   RubyArray ary = v.toAry();
   array_.addAll(ary.array_);
   return this;
 }
Exemple #4
0
 // @RubyLevelMethod(name="+")
 public RubyArray plus(RubyValue v) {
   return this.plus(v.toAry());
 }
Exemple #5
0
 // @RubyLevelMethod(name="<=>")
 public RubyValue compare(RubyValue v) {
   return this.compare(v.toAry());
 }