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/header_object.rb11
-rw-r--r--lib/yard/mruby/code_objects/namespace_object.rb16
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/yard/mruby/code_objects/header_object.rb b/lib/yard/mruby/code_objects/header_object.rb
index 99fb3cf..519d76c 100644
--- a/lib/yard/mruby/code_objects/header_object.rb
+++ b/lib/yard/mruby/code_objects/header_object.rb
@@ -3,5 +3,16 @@ module YARD::MRuby::CodeObjects
# A HeaderObject represents a MRuby header inside an include directory
# It groups C Functions and define macros.
class HeaderObject < YARD::CodeObjects::NamespaceObject
+ def functions
+ children.find_all {|d| d.is_a?(FunctionObject) }
+ end
+
+ def path
+ self.name
+ end
+
+ def title
+ super.to_s
+ end
end
end
diff --git a/lib/yard/mruby/code_objects/namespace_object.rb b/lib/yard/mruby/code_objects/namespace_object.rb
new file mode 100644
index 0000000..896b84b
--- /dev/null
+++ b/lib/yard/mruby/code_objects/namespace_object.rb
@@ -0,0 +1,16 @@
+module YARD::MRuby::CodeObjects
+
+ class NamespaceObject < YARD::CodeObjects::NamespaceObject
+ def value ; nil ; end
+ end
+
+ class IncludeDirectory < NamespaceObject
+ def headers
+ children
+ end
+ end
+
+ INCLUDE_DIRECTORY = IncludeDirectory.new(:root, "include")
+ ## YARD::Registry.register INCLUDE_DIRECTORY
+
+end