Class: Array
Instance Method Summary collapse
- #include?(*list) ⇒ Boolean
- #include_one?(*list) ⇒ Boolean
- #super_include? ⇒ Object
- #symbolize_hashes ⇒ Object
Instance Method Details
#include?(*list) ⇒ Boolean
5 6 7 |
# File 'lib/array.rb', line 5 def include?(*list) list.count == 1 ? super_include?(list.first) : ( self & list ).count == list.count end |
#include_one?(*list) ⇒ Boolean
9 10 11 |
# File 'lib/array.rb', line 9 def include_one?( *list ) (self & list).count > 0 end |
#super_include? ⇒ Object
2 |
# File 'lib/array.rb', line 2 alias :super_include? :include? |
#symbolize_hashes ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/array.rb', line 13 def symbolize_hashes z = [] self.each do |i| z << case i when Array then i.symbolize_hashes when Hash then i.keys_to_symbols else Marshal.load(Marshal.dump(i)) end end return z end |