From 48fb10fef522ab9262061bc612b44d74a8bda17d Mon Sep 17 00:00:00 2001 From: Seba Gamboa Date: Fri, 25 Sep 2015 13:12:22 -0300 Subject: Listing functions --- lib/yard/mruby/code_objects/function_object.rb | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'lib/yard/mruby/code_objects/function_object.rb') 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] 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] 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 -- cgit v1.2.3