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
Gemfile
History.rdoc
LICENSE
Manifest.txt
README.rdoc
Rakefile
vertere.gemspec

README.rdoc

vertere

Description

Provide a way of getting wrapper objects for inverted comparisons.

Features

Wrap below methods

  • #==

  • #===

  • #=~

  • #<=>

Usage

  • Setup

    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 Ruby's interface

    require 'vertere/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"]

Requirements

  • Ruby 1.9.2 or later

Installation

gem install vertere

Links

code

github.com/kachick/vertere

issues

github.com/kachick/vertere/issues

CI

travis-ci.org/#!/kachick/vertere

gem

rubygems.org/gems/vertere

gem+

metagem.info/gems/vertere

License

The MIT X License

Copyright © 2012 Kenichi Kamiya

See the file LICENSE for further details.

Something went wrong with that request. Please try again.