Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
4e63ea96
Commit
4e63ea96
authored
Nov 15, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3011 from Mav7/master
Added more YARD docs to mruby.h
parents
9c108002
66a839eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
build_config.rb
build_config.rb
+0
-1
include/mruby.h
include/mruby.h
+51
-1
No files found.
build_config.rb
View file @
4e63ea96
...
...
@@ -21,7 +21,6 @@ MRuby::Build.new do |conf|
# include the default GEMs
conf
.
gembox
'default'
# C compiler settings
# conf.cc do |cc|
# cc.command = ENV['CC'] || 'gcc'
...
...
include/mruby.h
View file @
4e63ea96
...
...
@@ -548,7 +548,7 @@ MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
MRB_API
struct
RClass
*
mrb_module_new
(
mrb_state
*
mrb
);
/**
*
Creates a new module, Module
.
*
Returns an mrb_bool. True if class was defined, and false if the class was not defined
.
*
* Example:
* void
...
...
@@ -610,8 +610,58 @@ MRB_API struct RClass * mrb_module_get(mrb_state *mrb, const char *name);
MRB_API
struct
RClass
*
mrb_module_get_under
(
mrb_state
*
mrb
,
struct
RClass
*
outer
,
const
char
*
name
);
MRB_API
mrb_value
mrb_notimplement_m
(
mrb_state
*
,
mrb_value
);
/**
* Duplicate an object.
*
* Equivalent to:
* Object#dup
* @param mrb The current mruby state.
* @param obj Object to be duplicate.
* @return The newly duplicated object.
*/
MRB_API
mrb_value
mrb_obj_dup
(
mrb_state
*
mrb
,
mrb_value
obj
);
MRB_API
mrb_value
mrb_check_to_integer
(
mrb_state
*
mrb
,
mrb_value
val
,
const
char
*
method
);
/**
* Returns true if obj responds to the given method. If the method was defined for that
* class it returns true, it returns false otherwise.
*
* Example:
* # Ruby style
* class ExampleClass
* def example_method
* end
* end
*
* ExampleClass.new.respond_to?(:example_method) # => true
*
* // C style
* void
* mrb_example_gem_init(mrb_state* mrb) {
* struct RClass *example_class;
* mrb_sym mid;
* mrb_bool obj_resp;
*
* example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class);
* mrb_define_method(mrb, example_class, "example_method", exampleMethod, MRB_ARGS_NONE());
* mid = mrb_intern_str(mrb, mrb_str_new_cstr(mrb, "example_method" ));
* obj_resp = mrb_obj_respond_to(mrb, example_class, mid); // => 1(true in Ruby world)
*
* // If mrb_obj_respond_to returns 1 then puts "True"
* // If mrb_obj_respond_to returns 0 then puts "False"
* if (obj_resp == 1) {
* puts("True");
* }
* else if (obj_resp == 0) {
* puts("False");
* }
* }
*
* @param mrb The current mruby state.
* @param c A reference to a class.
* @param mid A symbol referencing a method id.
* @return mrb_bool A boolean value.
*/
MRB_API
mrb_bool
mrb_obj_respond_to
(
mrb_state
*
mrb
,
struct
RClass
*
c
,
mrb_sym
mid
);
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment