class Array

Public Instance Methods

=~(other) click to toggle source

Adds the ability to check if Array contains a subset of objects or a single object. See toolbox/array

# File lib/toolbox/array.rb, line 6
def =~(other)
  if other.is_a?(::Array)
    other.each { |obj| return false unless self.include?(obj) }
    true
  else
    self.include?(other)
  end
end
Also aliased as: contains?
contains?(other)
Alias for: =~
to_json_pp() click to toggle source

Adds in-line ability to pretty-print an Array to JSON using entity.pretty_generate

# File lib/toolbox/json.rb, line 8
def to_json_pp
  JSON.pretty_generate(self)
end