README.md in array_include_methods-1.2.0 vs README.md in array_include_methods-1.3.0

- old
+ new

@@ -1,6 +1,6 @@ -# ArrayIncludeMethods 1.2.0 - Ruby Refinement +# ArrayIncludeMethods 1.3.0 - Ruby Refinement [![Gem Version](https://badge.fury.io/rb/array_include_methods.svg)](http://badge.fury.io/rb/array_include_methods) [![Build Status](https://travis-ci.com/AndyObtiva/array_include_methods.svg?branch=master)](https://travis-ci.com/AndyObtiva/array_include_methods) [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/array_include_methods/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/array_include_methods?branch=master) `Array#include_all?` & `Array#include_any?` methods missing from basic Ruby `Array` API. @@ -10,11 +10,11 @@ ### With Bundler: Include the following in Gemfile: ```ruby -gem 'array_include_methods', '~> 1.2.0' +gem 'array_include_methods', '~> 1.3.0' ``` Run: ``` @@ -24,11 +24,11 @@ ### Without Bundler: Run: ``` -gem install array_include_methods -v1.2.0 +gem install array_include_methods -v1.3.0 ``` ## Usage Add the following line to your application if you are not requiring all gems via Bundler (e.g. `Bundler.require(:default)`): @@ -49,31 +49,37 @@ ### `Array#include_any?(*other_array)` ```ruby [1, 2, 3, 4].include_any?(2, 4, 5) # returns true -[1, 2, 3, 4].include_any?([2, 4, 5]) # returns true [1, 2, 3, 4].include_any?(6, 7) # returns false -[1, 2, 3, 4].include_any?([6, 7]) # returns false -[1, 2, 3, 4].include_any?([]) # returns true +[1, 2, 3, 4].include_any?() # returns true [1, 2, 3, 4].include_any?(nil) # returns false ``` ### `Array#include_all?(*other_array)` ```ruby [1, 2, 3, 4].include_all?(2, 3) # returns true -[1, 2, 3, 4].include_all?([2, 3]) # returns true [1, 2, 3, 4].include_all?(2, 4) # returns true -[1, 2, 3, 4].include_all?([2, 4]) # returns false (checks true array containment) [1, 2, 3, 4].include_all?(4, 2) # returns true -[1, 2, 3, 4].include_all?([4, 2]) # returns false (checks true array containment) +[1, 2, 3, 4].include_all?(4, 2, same_sort: true) # returns false [1, 2, 3, 4].include_all?(2, 4, 4) # returns true -[1, 2, 3, 4].include_all?([2, 4, 4]) # returns false (checks true array containment) [1, 2, 3, 4].include_all?(2, 4, 5) # returns false -[1, 2, 3, 4].include_all?([2, 4, 5]) # returns false -[1, 2, 3, 4].include_all?([]) # returns true +[1, 2, 3, 4].include_all?() # returns true [1, 2, 3, 4].include_all?(nil) # returns false +``` + +### `Array#include_array?(other_array)` + +```ruby +[1, 2, 3, 4].include_array?([2, 3]) # returns true +[1, 2, 3, 4].include_array?([2, 4]) # returns false +[1, 2, 3, 4].include_array?([4, 2]) # returns false +[1, 2, 3, 4].include_array?([2, 4, 4]) # returns false +[1, 2, 3, 4].include_array?([2, 4, 5]) # returns false +[1, 2, 3, 4].include_array?([]) # returns true +[1, 2, 3, 4].include_array?([nil]) # returns false ``` ### `Array#array_index(other_array)` Returns first array index of `other_array` in `first_array` assuming `first_array.include_all?(other_array)` returns true