Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Require the extensions to tests pass in isolation | Rafael Mendonça França | 2015-03-30 | 1 | -0/+1 |
| | |||||
* | Revert "Remove Array#inquiry" | Rafael Mendonça França | 2015-03-30 | 1 | -0/+7 |
| | | | | | | This reverts commit 9420de59f5b7f5ceac77e28e6c326ec145f71f80. Reason: Turns out we want to keep this method. | ||||
* | Remove Array#inquiry | Rafael Mendonça França | 2015-03-27 | 1 | -7/+0 |
| | | | | | We are promoting too much a feature that will not be widler used. So for now lets keep just the ArrayInquirer constructor. | ||||
* | Add ActiveSupport::ArrayInquirer and Array#inquiry | George Claghorn | 2015-03-24 | 1 | -0/+35 |
Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its string-like contents. For example, `request.variant` returns an `ArrayInquirer` object. To check a request's variants, you can call: request.variant.phone? request.variant.any?(:phone, :tablet) ...instead of: request.variant.include?(:phone) request.variant.any? { |v| v.in?([:phone, :tablet]) } `Array#inquiry` is a shortcut for wrapping the receiving array in an `ArrayInquirer`: pets = [:cat, :dog] pets.cat? # => true pets.ferret? # => false pets.any?(:cat, :ferret} # => true |