项目作者: sshaw

项目描述 :
Did the method end with "?" or "!"‽ Interrobang gives you the best of both worlds‽
高级语言: Ruby
项目地址: git://github.com/sshaw/interrobang.git
创建时间: 2019-04-24T04:11:59Z
项目社区:https://github.com/sshaw/interrobang

开源协议:

下载


Interrobang

‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽‽

Did the method end with ? or !‽ Interrobang gives you the best of both worlds‽

Usage

  1. require "interrobang"
  2. class Foo
  3. def bar!
  4. "something amaaaaazing!"
  5. end
  6. def baz?
  7. false
  8. end
  9. end
  10. Interrobang.only(Foo)
  11. foo = Foo.new
  12. foo.bar! # "something amaaaaazing!"
  13. foo.bar # "something amaaaaazing!"
  14. foo.baz? # false
  15. foo.baz # false

Feeling really forgetful‽ No problem:

  1. Interrobang.everything
  2. %w[foo bar baz].include?("baz") # true
  3. %w[foo bar baz].include‽("baz") # true
  4. "sshaw!".chop! # "sshaw"
  5. "sshaw!".chop # "sshaw"

See Also

  • AngryRaise - raise exceptions, with emotion and intensity
  • class2 - DSL for creating class hierarchies
  • require3 - Kernel#require something and make it accessible via a different namespace
  • 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