Croperty
Just for fun to use annotation
to behave as Object#property
, Object#getter
, Object#setter
Installation
-
Add the dependency to your
shard.yml
:dependencies: croperty: github: firejox/croperty
-
Run
shards install
Usage
require "croperty"
@[Croperty::Property(x: Int32, init: 1)]
class Foo
include Croperty::Generator(self)
end
foo = Foo.new
puts foo.x # => 1
Contributing
- Fork it (https://github.com/firejox/croperty/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 a new Pull Request
Contributors
- Firejox - creator and maintainer