Skip to content

Commit 309b6ca

Browse files
nobumatzbot
authored andcommitted
[ruby/delegate] [DOC] Update missing docs and mark ups
ruby/delegate@020a6cfe4b
1 parent 2af6320 commit 309b6ca

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/delegate.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
# Be advised, RDoc will not detect delegated methods.
4040
#
4141
class Delegator < BasicObject
42+
# The version string
4243
VERSION = "0.4.0"
4344

4445
kernel = ::Kernel.dup
@@ -77,7 +78,7 @@ def initialize(obj)
7778
end
7879

7980
#
80-
# Handles the magic of delegation through \_\_getobj\_\_.
81+
# Handles the magic of delegation through +__getobj__+.
8182
#
8283
ruby2_keywords def method_missing(m, *args, &block)
8384
r = true
@@ -94,7 +95,7 @@ def initialize(obj)
9495

9596
#
9697
# Checks for a method provided by this the delegate object by forwarding the
97-
# call through \_\_getobj\_\_.
98+
# call through +__getobj__+.
9899
#
99100
def respond_to_missing?(m, include_private)
100101
r = true
@@ -107,7 +108,7 @@ def respond_to_missing?(m, include_private)
107108
r
108109
end
109110

110-
KERNEL_RESPOND_TO = ::Kernel.instance_method(:respond_to?)
111+
KERNEL_RESPOND_TO = ::Kernel.instance_method(:respond_to?) # :nodoc:
111112
private_constant :KERNEL_RESPOND_TO
112113

113114
# Handle BasicObject instances
@@ -126,23 +127,23 @@ def respond_to_missing?(m, include_private)
126127

127128
#
128129
# Returns the methods available to this delegate object as the union
129-
# of this object's and \_\_getobj\_\_ methods.
130+
# of this object's and +__getobj__+ methods.
130131
#
131132
def methods(all=true)
132133
__getobj__.methods(all) | super
133134
end
134135

135136
#
136137
# Returns the methods available to this delegate object as the union
137-
# of this object's and \_\_getobj\_\_ public methods.
138+
# of this object's and +__getobj__+ public methods.
138139
#
139140
def public_methods(all=true)
140141
__getobj__.public_methods(all) | super
141142
end
142143

143144
#
144145
# Returns the methods available to this delegate object as the union
145-
# of this object's and \_\_getobj\_\_ protected methods.
146+
# of this object's and +__getobj__+ protected methods.
146147
#
147148
def protected_methods(all=true)
148149
__getobj__.protected_methods(all) | super
@@ -175,7 +176,7 @@ def eql?(obj)
175176
end
176177

177178
#
178-
# Delegates ! to the \_\_getobj\_\_
179+
# Delegates ! to the +__getobj__+
179180
#
180181
def !
181182
!__getobj__
@@ -198,7 +199,7 @@ def __setobj__(obj)
198199
end
199200

200201
#
201-
# Serialization support for the object returned by \_\_getobj\_\_.
202+
# Serialization support for the object returned by +__getobj__+.
202203
#
203204
def marshal_dump
204205
ivars = instance_variables.reject {|var| /\A@delegate_/ =~ var}
@@ -232,7 +233,7 @@ def initialize_dup(obj) # :nodoc:
232233

233234
##
234235
# :method: freeze
235-
# Freeze both the object returned by \_\_getobj\_\_ and self.
236+
# Freeze both the object returned by +__getobj__+ and self.
236237
#
237238
def freeze
238239
__getobj__.freeze

0 commit comments

Comments
 (0)