Skip to content
This repository
Browse code

Fix indentation in code example of Delegation

  • Loading branch information...
commit 665322eaab7246a961ff6a90cdceaf63c277d8d1 1 parent 2c7ded3
Tomasz Zurkowski authored January 20, 2012
38  activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -81,25 +81,25 @@ class Module
81 81
   # no matter whether +nil+ responds to the delegated method. You can get a
82 82
   # +nil+ instead with the +:allow_nil+ option.
83 83
   #
84  
-  #  class Foo
85  
-  #    attr_accessor :bar
86  
-  #    def initialize(bar = nil)
87  
-  #      @bar = bar
88  
-  #    end
89  
-  #    delegate :zoo, :to => :bar
90  
-  #  end
91  
-  #
92  
-  #  Foo.new.zoo   # raises NoMethodError exception (you called nil.zoo)
93  
-  #
94  
-  #  class Foo
95  
-  #    attr_accessor :bar
96  
-  #    def initialize(bar = nil)
97  
-  #      @bar = bar
98  
-  #    end
99  
-  #    delegate :zoo, :to => :bar, :allow_nil => true
100  
-  #  end
101  
-  #
102  
-  #  Foo.new.zoo   # returns nil
  84
+  #   class Foo
  85
+  #     attr_accessor :bar
  86
+  #     def initialize(bar = nil)
  87
+  #       @bar = bar
  88
+  #     end
  89
+  #     delegate :zoo, :to => :bar
  90
+  #   end
  91
+  #
  92
+  #   Foo.new.zoo   # raises NoMethodError exception (you called nil.zoo)
  93
+  #
  94
+  #   class Foo
  95
+  #     attr_accessor :bar
  96
+  #     def initialize(bar = nil)
  97
+  #       @bar = bar
  98
+  #     end
  99
+  #     delegate :zoo, :to => :bar, :allow_nil => true
  100
+  #   end
  101
+  #
  102
+  #   Foo.new.zoo   # returns nil
103 103
   #
104 104
   def delegate(*methods)
105 105
     options = methods.pop

0 notes on commit 665322e

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