HairyDangerzone
Some demo thing.
Installation
Add this line to your application's Gemfile:
gem 'hairy_dangerzone'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hairy_dangerzone
Usage
class MyClass
include HairyDangerzone::Awesome
danger_danger :x, "Not a string" do |attr|
attr.is_a?(String)
end
end
i = MyClass.new
i.x = "ok"
i.x = 1 #=> should raise "Invalid String"
i.hairy_dangerzone_x?(1) #=> false
i.hairy_dangerzone_x?("Hello") #=> true
Contributing
- Fork it ( http://github.com/iamteem/hairy_dangerzone/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request