mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5083 from wataash/example-clarify-caller
examples/mrbgems: clarify the caller
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
module CRubyExtension
|
||||
def CRubyExtension.ruby_method
|
||||
puts "A Ruby Extension"
|
||||
puts "#{self}: A Ruby Extension"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static mrb_value
|
||||
mrb_c_method(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
puts("A C Extension");
|
||||
mrb_value self_str = mrb_str_to_str(mrb, self);
|
||||
|
||||
printf("%s: A C Extension\n", mrb_str_to_cstr(mrb, self_str));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static mrb_value
|
||||
mrb_c_method(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
puts("A C Extension");
|
||||
mrb_value self_str = mrb_str_to_str(mrb, self);
|
||||
|
||||
printf("%s: A C Extension\n", mrb_str_to_cstr(mrb, self_str));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class RubyExtension
|
||||
def RubyExtension.ruby_method
|
||||
puts "A Ruby Extension"
|
||||
puts "#{self}: A Ruby Extension"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user