class Array

class TrueArray < Array

def each; end

def size
  1  # ?
end

def empty?
  false
end

def &(other)
  other.dup
end

def |(other)
  other.dup
end

## If this would have worked we would not have had
## to override Array.
#def coerce(other)
#  return self, other
#end

end

Public Instance Methods

&(other) click to toggle source
# File lib/ergo/core_ext/true_class.rb, line 55
def &(other)
  TrueClass === other ? dup : and_without_t(other)
end
Also aliased as: and_without_t
and_without_t(other)
Alias for: &
or_without_t(other)
Alias for: |
|(other) click to toggle source
# File lib/ergo/core_ext/true_class.rb, line 51
def |(other)
  TrueClass === other ? dup : or_without_t(other)
end
Also aliased as: or_without_t