Class: Object

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

Overview

TODO mixin from a separate module

Instance Method Summary collapse

Instance Method Details

#desc_method(name, options = {}) ⇒ Object

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



142
143
144
145
146
147
148
149
# File 'lib/method_describer/method_desc.rb', line 142

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