GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of lifo/doc-rails
Description: Repository for improving Rails documentation
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/zmalltalker/doc-rails.git
Improving the documentation for cattr* and mattr* accessor methods.
leethal (author)
Wed Apr 09 04:06:47 -0700 2008
commit  24fa99616202f06caf41642aca07943dcdd8b632
tree    bab520a77bad9b107063df254f660a29bb0340c5
parent  4dc83fdbc844ba75c6ece9ba0826447c0dc360e1
...
1
2
3
 
 
 
 
 
 
 
4
5
6
...
1
2
 
3
4
5
6
7
8
9
10
11
12
0
@@ -1,6 +1,12 @@
0
 # Extends the class object with class and instance accessors for class attributes,
0
 # just like the native attr* accessors for instance attributes.
0
-class Class # :nodoc:
0
+#
0
+# class Person
0
+# cattr_accessor :hair_colors
0
+# end
0
+#
0
+# Person.hair_colors = [:brown, :black, :blonde, :red]
0
+class Class
0
   def cattr_reader(*syms)
0
     syms.flatten.each do |sym|
0
       next if sym.is_a?(Hash)
...
1
2
3
 
 
 
 
 
 
 
 
 
 
 
4
5
6
...
1
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0
@@ -1,6 +1,16 @@
0
 # Extends the module object with module and instance accessors for class attributes,
0
 # just like the native attr* accessors for instance attributes.
0
-class Module # :nodoc:
0
+#
0
+# module AppConfiguration
0
+# mattr_accessor :google_api_key
0
+# self.google_api_key = "123456789"
0
+#
0
+# mattr_accessor :paypal_url
0
+# self.paypal_url = "www.sandbox.paypal.com"
0
+# end
0
+#
0
+# AppConfiguration.google_api_key = "overriding the api key!"
0
+class Module
0
   def mattr_reader(*syms)
0
     syms.each do |sym|
0
       next if sym.is_a?(Hash)

Comments

    No one has commented yet.