Skip to content

Interrogate attempts to bring Scheme-like class predication to Ruby.

License

Notifications You must be signed in to change notification settings

nycrubypro/interrogate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interrogate Build Status

Interrogate attempts to bring Scheme-like class predication to Ruby. It provides an alternate syntax using Module#===.

>> String?("Hello")
>> trues
>> Symbol?(:World)
>> true
>> Float?(1.0)
>> true

You can "interrogate" multiple objects as well:

>> String?("Hello", :World, 1.0)
>> false
>> String?("Hello", "World", "1.0")
>> true

And you can "interrogate" the return value of a block:

>> num = 1
>> String?("Hello") { num }
>> false
>> String?("Hello") { num.to_s }
>> true

Feedback

Use that Github issue tracker!

About

Interrogate attempts to bring Scheme-like class predication to Ruby.

Resources

License

Stars

Watchers

Forks

Packages

No packages published