Skip to content

Commit 5d36757

Browse files
committed
Refactor KRPC::Doc
1 parent 46c1ce0 commit 5d36757

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/krpc/doc.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def docstring_for_method(method_owner, method_name, is_print_xmldoc_summary = tr
1616
construct_docstring(*@docstr_infos[key], true, is_static, is_print_xmldoc_summary)
1717
else
1818
"No docstring for #{class_cls.name}#{calc_separator(is_static)}#{method_name.to_s} method" +
19-
(method_owner.respond_to?(method_name) ? "" : "\nThere is no such method -- maybe a typo")
19+
(method_owner.respond_to?(method_name) ? "" : "\nThere is no such method -- maybe a typo?")
2020
end
2121
end
2222

@@ -138,7 +138,7 @@ def xmlElements2str(elements, main_color, paramref_color, value_color, error_col
138138
elem.text.gsub("null","nil").colorize(value_color)
139139
else elem.to_s.colorize(error_color)
140140
end
141-
rescue RuntimeException => exc
141+
rescue RuntimeException
142142
elem.to_s.colorize(error_color)
143143
end
144144
end
@@ -163,12 +163,7 @@ module SuffixMethods
163163
DOCSTRING_SUFFIX_REGEX = /^(.+)(?:#{DOCSTRING_SUFFIX}(=)?)$/
164164

165165
def self.included(base)
166-
base.extend self
167-
class << base
168-
def krpc_name
169-
class_name
170-
end
171-
end
166+
base.extend self, ClassMethods
172167
end
173168

174169
def method_missing(method, *args, &block)
@@ -187,6 +182,12 @@ def respond_to_missing?(method, *)
187182
end
188183
super
189184
end
185+
186+
module ClassMethods
187+
def krpc_name
188+
class_name
189+
end
190+
end
190191
end
191192

192193
end

0 commit comments

Comments
 (0)