summaryrefslogtreecommitdiffhomepage
path: root/lib/yard/mruby/code_objects
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yard/mruby/code_objects')
-rw-r--r--lib/yard/mruby/code_objects/function_object.rb27
-rw-r--r--lib/yard/mruby/code_objects/header_object.rb4
-rw-r--r--lib/yard/mruby/code_objects/headers_root.rb5
3 files changed, 35 insertions, 1 deletions
diff --git a/lib/yard/mruby/code_objects/function_object.rb b/lib/yard/mruby/code_objects/function_object.rb
index 0a835b5..c726762 100644
--- a/lib/yard/mruby/code_objects/function_object.rb
+++ b/lib/yard/mruby/code_objects/function_object.rb
@@ -2,6 +2,14 @@ module YARD::MRuby::CodeObjects
# A FunctionObject represents a MRuby C API function declaration inside a header inside an include directory
class FunctionObject < YARD::CodeObjects::Base
+
+ # Returns the list of parameters parsed out of the method signature
+ # with their default values.
+ #
+ # @return [Array<Array(String, String)>] a list of parameter names followed
+ # by their default values (or nil)
+ attr_accessor :parameters
+
def initialize(header, name, &block)
super
end
@@ -14,6 +22,25 @@ module YARD::MRuby::CodeObjects
def path
self.name
end
+
+ def attr_info
+ nil
+ end
+
+ def scope
+ ''
+ end
+
+ # Returns all alias names of the object
+ # @return [Array<Symbol>] the alias names
+ def aliases
+ list = []
+ return list unless namespace.is_a?(HeaderObject)
+ namespace.aliases.each do |o, aname|
+ list << o if aname == name && o.scope == scope
+ end
+ list
+ end
end
end
diff --git a/lib/yard/mruby/code_objects/header_object.rb b/lib/yard/mruby/code_objects/header_object.rb
index 519d76c..2e70230 100644
--- a/lib/yard/mruby/code_objects/header_object.rb
+++ b/lib/yard/mruby/code_objects/header_object.rb
@@ -14,5 +14,9 @@ module YARD::MRuby::CodeObjects
def title
super.to_s
end
+
+ def inheritance_tree(*args)
+ return [self]
+ end
end
end
diff --git a/lib/yard/mruby/code_objects/headers_root.rb b/lib/yard/mruby/code_objects/headers_root.rb
index 45806ff..6522c9a 100644
--- a/lib/yard/mruby/code_objects/headers_root.rb
+++ b/lib/yard/mruby/code_objects/headers_root.rb
@@ -4,8 +4,11 @@ module YARD::MRuby::CodeObjects
def headers
children
end
+
+ def inheritance_tree(*args)
+ return [self]
+ end
end
HEADERS_ROOT = HeadersRoot.new(:root, "headers")
-
end