This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sat Oct 31 16:27:29 -0700 2009 | |
| |
README | Sat Oct 31 16:27:29 -0700 2009 | |
| |
init.rb | Sat Oct 31 16:27:29 -0700 2009 | |
| |
lib/ | Sat Oct 31 16:27:29 -0700 2009 |
README
HasClassAttr
============
has_class_attr is a small helper plugin. It really is not tied to rails, but I
think it is too small for a gem :)
Its purpose is to set a instance variable on a class definition and expose it
through a method.
Example
=======
Old Way:
def MyClass
@items = [1,2,3]
def self.static_items
@items
end
end
MyClass.static_items #[1,2,3]
New Way:
def MyClass
has_class_attr :items, :data => [1,2,3]
end
MyClass.items #[1,2,3]
Copyright (c) 2009 StarterStep, released under the MIT license







