Iñaki Baz Castillo
9/5/2008 7:49:00 PM
El Viernes, 5 de Septiembre de 2008, Jason Lillywhite escribi=C3=B3:
> It seems odd that cattr_* (i.e. cattr_accessor, cattr_reader,
> cattr_writer) is not in the native Ruby and that you have to require
> active support and rubygems to get this to work. Including the rails
> stuff appears to slow things down a little. Why is this not built in the
> native Ruby source?
Note that you can do the same using:
=2D-----------
class MyClass
=09
class << self
attr_accessor :class_attribute_1, :class_attribute_2
end
end
=2D----------
So you can use it:
=2D---------
MyClass.class_attribute_1 =3D something
=2D--------
=2D-=20
I=C3=B1aki Baz Castillo