Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Get wrapper for inverted comparisons.
Ruby
tree: c56406be55

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
.gitignore
History.rdoc
LICENSE
Manifest.txt
README.rdoc
Rakefile

README.rdoc

vertere

Description

Provide a way to get wrapper objects for inverted comparisons

Features

Wrap below methods

  • #==

  • #===

  • #=~

  • #<=>

Usage

  • Setup

    require 'vertere'
  • An approaching to invert comparisons # from [ruby-talk:392128]

    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

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.