Class: YARD::Tags::MethodDirective

Inherits:
Object
  • Object
show all
Defined in:
lib/yard-js/core_ext/yard/tags.rb

Instance Method Summary collapse

Instance Method Details

#create_objectObject


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/yard-js/core_ext/yard/tags.rb', line 13

def create_object
  name = method_name
  visibility = parser.state.visibility || handler.visibility
  ns = CodeObjects::NamespaceObject === object ? object : handler.namespace
  obj = YARDJS::CodeObjects::PropertyObject.new(ns, name)
  handler.register_file_info(obj)
  handler.register_source(obj)
  handler.register_visibility(obj, visibility)
  handler.register_group(obj)
  obj.signature = method_signature
  obj.parameters = OverloadTag.new(:overload, method_signature).parameters
  obj.docstring = Docstring.new!(parser.text, parser.tags, obj,
    parser.raw_text)
  obj.property_type = :function
  handler.register_module_function(obj)
  obj
end

#method_nameObject


4
5
6
7
8
9
10
11
# File 'lib/yard-js/core_ext/yard/tags.rb', line 4

def method_name
  sig = sanitized_tag_signature
  if sig
    sig[/\A\s*([^\(; \t]+)/, 1]
  else
    handler.call_params.first
  end
end