Singleton Attributes

http://rubygems.org/gems/singleton_attr

Summary

Adds methods to declare attribute accessor/reader/writer on singleton instance and methods to alias singleton methods.

Description

Provides :singleton_attr_accessor, :singleton_attr_reader, :singleton_attr_writer, :module_attr_accessor, :module_attr_reader, :module_attr_writer, :class_attr_accessor, :class_attr_reader, :class_attr_writer as well as :alias_singleton_method, :alias_module_method, and :alias_class_method.

Install

  • sudo gem install singleton_attr

Usage

Just like :attr_accessor, :attr_reader, :attr_writer, :alias_method but instead of defining an instance method it defines a class/module method.

License

(The MIT License)

Copyright (c) 2013 Ridiculous Power, Asher

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.