9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/yard-settings/handler.rb', line 9
def process
name = statement.parameters.first.jump(:tstring_content, :ident).source
object = YARD::CodeObjects::MethodObject.new(namespace, name)
register(object)
object.dynamic = true
object['custom_field'] = '(Found using method_missing)'
hutch_config = YARD::CodeObjects::ModuleObject.new(:root, "Hutch::Config")
collection_name = statement.first.first
default_value = statement.parameters[1].jump(:tstring_content, :ident).source
(hutch_config['setting_rows'] ||= []) << {
name: name,
default_value: default_value,
type: collection_name.sub('_setting', '').capitalize,
description: object.docstring,
first_line_of_description: first_line_of_description(object)
}
end
|