kattr
Works much like the version for rails (except it doesn't accept blocks and doesn't use eval).
It is prefered to use kattr_*
instead of cattr_*
so there are no confusion. If you are using
this gem outside of rails, it should be alright
class Moo
cattr_accessor :cow
end
Moo.cow = 'animal'
Moo.class_variables
#=> [:@@cow]
Note on Patches/Pull Requests
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright
Copyright (c) 2010 Daniel Bretoi. See LICENSE for details.