https://github.com/sshaw/interrobang
Did the method end with "?" or "!"‽ Interrobang gives you the best of both worlds‽
https://github.com/sshaw/interrobang
exclamation interrobang metaprogramming question-mark ruby
Last synced: about 1 year ago
JSON representation
Did the method end with "?" or "!"‽ Interrobang gives you the best of both worlds‽
- Host: GitHub
- URL: https://github.com/sshaw/interrobang
- Owner: sshaw
- Created: 2019-04-24T04:11:59.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-29T05:06:07.000Z (about 7 years ago)
- Last Synced: 2025-02-12T06:59:43.172Z (over 1 year ago)
- Topics: exclamation, interrobang, metaprogramming, question-mark, ruby
- Language: Ruby
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Interrobang
‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽
Did the method end with `?` or `!`‽ Interrobang gives you the best of both worlds‽
## Usage
```rb
require "interrobang"
class Foo
def bar!
"something amaaaaazing!"
end
def baz?
false
end
end
Interrobang.only(Foo)
foo = Foo.new
foo.bar! # "something amaaaaazing!"
foo.bar‽ # "something amaaaaazing!"
foo.baz? # false
foo.baz‽ # false
```
Feeling _really_ forgetful‽ No problem:
```rb
Interrobang.everything
%w[foo bar baz].include?("baz") # true
%w[foo bar baz].include‽("baz") # true
"sshaw!".chop! # "sshaw"
"sshaw!".chop‽ # "sshaw"
```
## See Also
* [AngryRaise](https://github.com/sshaw/angry_raise) - `raise` exceptions, with emotion and intensity
* [class2](https://github.com/sshaw/class2) - DSL for creating class hierarchies
* [require3](https://github.com/sshaw/require3) - `Kernel#require` something and make it accessible via a different namespace
* [YYMMDD](https://github.com/sshaw/yymmdd) - Tiny DSL for idiomatic date parsing and formatting
## Author
Skye Shaw [skye.shaw AT gmail]
## License
Released under the MIT License: http://www.opensource.org/licenses/MIT