Module: Boson::MethodInspector::API

Included in:
Boson::MethodInspector
Defined in:
lib/boson/method_inspector.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) during_new_method_added(mod, meth)

Method hook called during new_method_added



88
# File 'lib/boson/method_inspector.rb', line 88

def during_new_method_added(mod, meth); end

- (Boolean) has_inspector_method?(meth, inspector)

Determines if method's arguments should be scraped



106
107
108
# File 'lib/boson/method_inspector.rb', line 106

def has_inspector_method?(meth, inspector)
  true
end

- (Object) set_arguments(mod, meth)



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/boson/method_inspector.rb', line 90

def set_arguments(mod, meth)
  store[:args] ||= {}

  args = mod.instance_method(meth).parameters.map do|(type, name)|
    case type
    when :rest then ["*#{name}"]
    when :req  then [name.to_s]
    when :opt  then [name.to_s, '']
    else nil
    end
  end.compact

  store[:args][meth.to_s] = args
end