summaryrefslogtreecommitdiffhomepage
path: root/lib/yard/mruby/code_objects/function_object.rb
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-25 13:12:22 -0300
committerSeba Gamboa <[email protected]>2015-09-25 13:12:22 -0300
commit48fb10fef522ab9262061bc612b44d74a8bda17d (patch)
treec48dcb77245e4a6b15af4366e96c31d6eb1cdd93 /lib/yard/mruby/code_objects/function_object.rb
parente0e43a79d282d69f2f45d5cf71e0e1154357d181 (diff)
downloadyard-mruby-48fb10fef522ab9262061bc612b44d74a8bda17d.tar.gz
yard-mruby-48fb10fef522ab9262061bc612b44d74a8bda17d.zip
Listing functions
Diffstat (limited to 'lib/yard/mruby/code_objects/function_object.rb')
-rw-r--r--lib/yard/mruby/code_objects/function_object.rb27
1 files changed, 27 insertions, 0 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