summaryrefslogtreecommitdiffhomepage
path: root/lib/yard/mruby/code_objects
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-28 18:29:41 -0300
committerSeba Gamboa <[email protected]>2015-09-28 18:29:41 -0300
commit73326c64a5e720f7d31b1e52ef9fda341895e800 (patch)
tree065b8ed13fa31c8a910433fe41be8f1bbd213aac /lib/yard/mruby/code_objects
parent2c3c127806e64ecc32b995913778252a2212c6a9 (diff)
downloadyard-mruby-73326c64a5e720f7d31b1e52ef9fda341895e800.tar.gz
yard-mruby-73326c64a5e720f7d31b1e52ef9fda341895e800.zip
Handle #define directives
Diffstat (limited to 'lib/yard/mruby/code_objects')
-rw-r--r--lib/yard/mruby/code_objects/define_object.rb2
-rw-r--r--lib/yard/mruby/code_objects/function_object.rb11
-rw-r--r--lib/yard/mruby/code_objects/header_base_object.rb15
3 files changed, 17 insertions, 11 deletions
diff --git a/lib/yard/mruby/code_objects/define_object.rb b/lib/yard/mruby/code_objects/define_object.rb
index 2c05d91..4220acd 100644
--- a/lib/yard/mruby/code_objects/define_object.rb
+++ b/lib/yard/mruby/code_objects/define_object.rb
@@ -1,7 +1,7 @@
module YARD::MRuby::CodeObjects
# A DefineObject represents a MRuby C API define macro declaration inside a header inside an include directory
- class DefineObject < YARD::CodeObjects::Base
+ class DefineObject < HeaderBaseObject
end
end
diff --git a/lib/yard/mruby/code_objects/function_object.rb b/lib/yard/mruby/code_objects/function_object.rb
index 7d85439..ecf7dd5 100644
--- a/lib/yard/mruby/code_objects/function_object.rb
+++ b/lib/yard/mruby/code_objects/function_object.rb
@@ -1,7 +1,7 @@
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
+ class FunctionObject < HeaderBaseObject
# Returns the list of parameters parsed out of the method signature
# with their default values.
@@ -14,15 +14,6 @@ module YARD::MRuby::CodeObjects
super
end
- def header
- self.namespace
- end
-
- # Function's shouln't be namespaced
- def path
- self.name.to_s
- end
-
def attr_info
nil
end
diff --git a/lib/yard/mruby/code_objects/header_base_object.rb b/lib/yard/mruby/code_objects/header_base_object.rb
new file mode 100644
index 0000000..403db3d
--- /dev/null
+++ b/lib/yard/mruby/code_objects/header_base_object.rb
@@ -0,0 +1,15 @@
+module YARD::MRuby::CodeObjects
+
+ # A FunctionObject represents a MRuby C API function declaration inside a header inside an include directory
+ class HeaderBaseObject < YARD::CodeObjects::Base
+
+ def header
+ self.namespace
+ end
+
+ # Header objects's shouln't be namespaced
+ def path
+ self.name.to_s
+ end
+ end
+end