Class: Array

Inherits:
Object show all
Defined in:
lib/homeschool.rb

Instance Method Summary collapse

Instance Method Details

#includes_all?(array) ⇒ Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/homeschool.rb', line 116

def includes_all?(array)
  array.all? &method(:include?)
end

#includes_any?(array) ⇒ Boolean

Returns:

  • (Boolean)


113
114
115
# File 'lib/homeschool.rb', line 113

def includes_any?(array)
  array.any? &method(:include?)
end

#includes_only?(array) ⇒ Boolean

Returns:

  • (Boolean)


119
120
121
# File 'lib/homeschool.rb', line 119

def includes_only?(array)
  array.length == length && includes_all?(array)
end