Skip to content
This repository
Browse code

bringing consistency in comments

  • Loading branch information...
commit 082ca51d65c988333c9afbda73cec857687bd4d9 1 parent 8429e7b
Neeraj Singh authored July 24, 2010
31  activerecord/lib/active_record/reflection.rb
@@ -50,7 +50,7 @@ def reflect_on_aggregation(aggregation)
50 50
       # Returns an array of AssociationReflection objects for all the 
51 51
       # associations in the class. If you only want to reflect on a certain 
52 52
       # association type, pass in the symbol (<tt>:has_many</tt>, <tt>:has_one</tt>, 
53  
-      # <tt>:belongs_to</tt>) for that as the first parameter.
  53
+      # <tt>:belongs_to</tt>) as the first parameter.
54 54
       #
55 55
       # Example:
56 56
       #
@@ -62,9 +62,9 @@ def reflect_on_all_associations(macro = nil)
62 62
         macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections
63 63
       end
64 64
 
65  
-      # Returns the AssociationReflection object for the named +association+ (use the symbol). Example:
  65
+      # Returns the AssociationReflection object for the +association+ (use the symbol).
66 66
       #
67  
-      #   Account.reflect_on_association(:owner) # returns the owner AssociationReflection
  67
+      #   Account.reflect_on_association(:owner)             # returns the owner AssociationReflection
68 68
       #   Invoice.reflect_on_association(:line_items).macro  # returns :has_many
69 69
       #
70 70
       def reflect_on_association(association)
@@ -88,34 +88,37 @@ def initialize(macro, name, options, active_record)
88 88
         @macro, @name, @options, @active_record = macro, name, options, active_record
89 89
       end
90 90
 
91  
-      # Returns the name of the macro.  For example, <tt>composed_of :balance, 
92  
-      # :class_name => 'Money'</tt> will return <tt>:balance</tt> or for 
93  
-      # <tt>has_many :clients</tt> it will return <tt>:clients</tt>.
  91
+      # Returns the name of the macro.
  92
+      # <tt>composed_of :balance, :class_name => 'Money'</tt> will return <tt>:balance</tt> 
  93
+      # <tt>has_many :clients</tt> will return <tt>:clients</tt>
94 94
       def name
95 95
         @name
96 96
       end
97 97
 
98  
-      # Returns the macro type. For example, 
  98
+      # Returns the macro type. 
99 99
       # <tt>composed_of :balance, :class_name => 'Money'</tt> will return <tt>:composed_of</tt>
100  
-      # or for <tt>has_many :clients</tt> will return <tt>:has_many</tt>.
  100
+      # <tt>has_many :clients</tt> will return <tt>:has_many</tt>
101 101
       def macro
102 102
         @macro
103 103
       end
104 104
 
105  
-      # Returns the hash of options used for the macro.  For example, it would return <tt>{ :class_name => "Money" }</tt> for
106  
-      # <tt>composed_of :balance, :class_name => 'Money'</tt> or +{}+ for <tt>has_many :clients</tt>.
  105
+      # Returns the hash of options used for the macro.  
  106
+      # <tt>composed_of :balance, :class_name => 'Money'</tt> will return <tt>{ :class_name => "Money" }</tt>
  107
+      # <tt>has_many :clients</tt> will return +{}+
107 108
       def options
108 109
         @options
109 110
       end
110 111
 
111  
-      # Returns the class for the macro.  For example, <tt>composed_of :balance, :class_name => 'Money'</tt> returns the Money
112  
-      # class and <tt>has_many :clients</tt> returns the Client class.
  112
+      # Returns the class for the macro.  
  113
+      # <tt>composed_of :balance, :class_name => 'Money'</tt> will return the Money class
  114
+      # <tt>has_many :clients</tt> will return the Client class
113 115
       def klass
114 116
         @klass ||= class_name.constantize
115 117
       end
116 118
 
117  
-      # Returns the class name for the macro.  For example, <tt>composed_of :balance, :class_name => 'Money'</tt> returns <tt>'Money'</tt>
118  
-      # and <tt>has_many :clients</tt> returns <tt>'Client'</tt>.
  119
+      # Returns the class name for the macro.  
  120
+      # <tt>composed_of :balance, :class_name => 'Money'</tt> will return <tt>'Money'</tt>
  121
+      # <tt>has_many :clients</tt> will return <tt>'Client'</tt>
119 122
       def class_name
120 123
         @class_name ||= options[:class_name] || derive_class_name
121 124
       end

0 notes on commit 082ca51

Please sign in to comment.
Something went wrong with that request. Please try again.