Class: Object

Inherits:
BasicObject
Defined in:
lib/method_describer/method_desc.rb

Overview

LTODO mixin from a separate module

Instance Method Summary collapse

Instance Method Details

#desc_method(name, options = {}) ⇒ Object Also known as: desc

currently rather verbose, but will attempt to describe all it knows about a method



158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/method_describer/method_desc.rb', line 158

def desc_method name, options = {}
  if self.is_a? Class
    # i.e. String.strip
    begin
     instance_method(name).desc(options)
   rescue => e
     # allow for Class.instance_method_name
     method(name).desc(options)
   end
  else
    method(name).desc(options)
  end
end