Skip to content

Generate antonym predicates methods for each regular predicate of a class or instance.

Notifications You must be signed in to change notification settings

oddlyfunctional/antonym-predicates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antonym Predicates

Generate antonym predicates methods for each regular predicate of a class or instance. If the method’s name is in the dictionary, then the antonym is used. Otherwise, the form is “not_#{method_name}”

Usage

The only thing that you need to configure is the dictionary. Include any antonyms that you want to use.

require 'antonym_predicates'
AntonymPredicates.antonyms = {
    "equal"         => "different",
    "is_a"          => "isnt_a",
    "respond_to"    => "doesnt_respont_to"
}

Then you can generate antonym methods doing the following:

AntonymPredicates.generate_antonyms String

You can also pass a list to the generate_antonyms method.

AntonymPredicates.generate_antonyms String, Integer

Found a bug?

If you are having a problem with Antonym Predicates, please submit an issue here.

github.com/mrodrigues/antonym-predicates/issues

About

Generate antonym predicates methods for each regular predicate of a class or instance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages