Skip to content
Get wrapper for inverted comparisons.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
lib
test
.gitignore
.travis.yml
.yardopts
Gemfile
MIT-LICENSE
README.md
Rakefile
vertere.gemspec

README.md

vertere

Build Status Gem Version Dependency Status

Description

Get wrapper for inverted comparisons.

Features

Wraps

  • #==
  • #===
  • #=~
  • #<=>

Usage

require 'vertere'

# An approaching to invert comparisons
num_chars = %w[0 1 9 10 11]
num_chars.grep(/0/)                  #=> ["0", "10"]
num_chars.grep(Veretere.invert(/0/)) #=> ["1", "9", "11"]

# Extend core classies
require 'vertere/core_ext'
num_chars.grep(/0/.for_!)            #=> ["1", "9", "11"]

# And more
num_chars.sort_by{|s|s.to_i.for_!}   #=> ["11", "10", "9", "1", "0"]

But I suggest Enumerable#grep_v from Ruby 2.3 :).

Requirements

Install

$ gem install vertere

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.

Something went wrong with that request. Please try again.