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
a5b416e2
Commit
a5b416e2
authored
Oct 14, 2015
by
Ralph Desir(Mav7)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added documentation for mrb_undef_method
parent
6276227e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
5 deletions
+64
-5
build_config.rb
build_config.rb
+3
-3
include/mruby.h
include/mruby.h
+61
-2
No files found.
build_config.rb
View file @
a5b416e2
...
@@ -21,7 +21,7 @@ MRuby::Build.new do |conf|
...
@@ -21,7 +21,7 @@ MRuby::Build.new do |conf|
# include the default GEMs
# include the default GEMs
conf
.
gembox
'default'
conf
.
gembox
'default'
conf
.
gem
'/home/thamav/tests/mrbgems_test'
# C compiler settings
# C compiler settings
# conf.cc do |cc|
# conf.cc do |cc|
# cc.command = ENV['CC'] || 'gcc'
# cc.command = ENV['CC'] || 'gcc'
...
@@ -82,7 +82,7 @@ MRuby::Build.new do |conf|
...
@@ -82,7 +82,7 @@ MRuby::Build.new do |conf|
# bintest
# bintest
# conf.enable_bintest
# conf.enable_bintest
end
end
=begin
MRuby::Build.new('host-debug') do |conf|
MRuby::Build.new('host-debug') do |conf|
# load specific toolchain settings
# load specific toolchain settings
...
@@ -117,7 +117,7 @@ MRuby::Build.new('test') do |conf|
...
@@ -117,7 +117,7 @@ MRuby::Build.new('test') do |conf|
conf.gembox 'default'
conf.gembox 'default'
end
end
=end
# Define cross build settings
# Define cross build settings
# MRuby::CrossBuild.new('32bit') do |conf|
# MRuby::CrossBuild.new('32bit') do |conf|
# toolchain :gcc
# toolchain :gcc
...
...
include/mruby.h
View file @
a5b416e2
...
@@ -243,8 +243,8 @@ MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value);
...
@@ -243,8 +243,8 @@ MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value);
* Include a module in another class or module.
* Include a module in another class or module.
* Equivalent to:
* Equivalent to:
*
*
* module B
*
* module B
* include A
*
* include A
* end
* end
* @param mrb_state* The current mruby state.
* @param mrb_state* The current mruby state.
* @param RClass* A reference to module or a class.
* @param RClass* A reference to module or a class.
...
@@ -348,6 +348,65 @@ MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*,
...
@@ -348,6 +348,65 @@ MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*,
* @param mrb_value The value for the constant.
* @param mrb_value The value for the constant.
*/
*/
MRB_API
void
mrb_define_const
(
mrb_state
*
,
struct
RClass
*
,
const
char
*
name
,
mrb_value
);
MRB_API
void
mrb_define_const
(
mrb_state
*
,
struct
RClass
*
,
const
char
*
name
,
mrb_value
);
/**
* Undefines a method.
*
* # Ruby style
*
* class A
*
* def a
* "a"
* end
*
* end
*
* A.new.a # => a
*
* class B < A
*
* undef_method :a
*
* end
*
* B.new.a # => undefined method 'a' for B (NoMethodError)
*
* // C style
*
* mrb_value
* mrb_a(mrb_state *mrb){
*
* return mrb_str_new_cstr(mrb, "a");
*
* }
*
* void
* mrb_example_gem_init(mrb_state* mrb){
* struct RClass *a;
* struct RClass *b;
* struct RClass *c;
*
* a = mrb_define_class(mrb, "A", mrb->object_class);
*
* mrb_define_method(mrb, a, "a", mrb_a, MRB_ARGS_NONE());
*
* b = mrb_define_class(mrb, "B", a);
*
* c = mrb_define_class(mrb, "C", b);
*
* mrb_undef_method(mrb, c, "a");
*
* }
*
* mrb_example_gem_final(mrb_state* mrb){
*
* }
*
* @param mrb_state* The MRuby state reference.
* @param RClass* A class the method will be undefined from.
* @param constchar* The name of the method to be undefined.
*/
MRB_API
void
mrb_undef_method
(
mrb_state
*
,
struct
RClass
*
,
const
char
*
);
MRB_API
void
mrb_undef_method
(
mrb_state
*
,
struct
RClass
*
,
const
char
*
);
MRB_API
void
mrb_undef_class_method
(
mrb_state
*
,
struct
RClass
*
,
const
char
*
);
MRB_API
void
mrb_undef_class_method
(
mrb_state
*
,
struct
RClass
*
,
const
char
*
);
...
...
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