Skip to content

Commit 523f7b2

Browse files
committed
class Net -> module Net
1 parent 49407e8 commit 523f7b2

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

mrbgems/picoruby-net/mrblib/net.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Net
1+
module Net
22
class HTTPUtil
33
def self.format_response(raw_response)
44
if raw_response.is_a?(String)

mrbgems/picoruby-net/mrblib/ntp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Net
1+
module Net
22
class NTP
33
NTP_SERVER = "pool.ntp.org"
44
NTP_PORT = 123

mrbgems/picoruby-net/sig/net.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type httpreturn = {
55
body: String
66
}
77

8-
class Net
8+
module Net
99
class HTTPUtil
1010
def self.format_response: (String?) -> (httpreturn | nil)
1111
end

mrbgems/picoruby-net/sig/ntp.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Net
1+
module Net
22
class NTP
33
NTP_SERVER: String
44
NTP_PORT: Integer

mrbgems/picoruby-net/src/mruby/net.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ mrb_net_udpclient_s__send_impl(mrb_state *mrb, mrb_value self)
8181
void
8282
mrb_picoruby_net_gem_init(mrb_state* mrb)
8383
{
84-
struct RClass *class_Net = mrb_define_class_id(mrb, MRB_SYM(Net), mrb->object_class);
84+
struct RClass *module_Net = mrb_define_module_id(mrb, MRB_SYM(Net));
8585

86-
struct RClass *class_Net_DNS = mrb_define_class_under_id(mrb, class_Net, MRB_SYM(DNS), mrb->object_class);
86+
struct RClass *class_Net_DNS = mrb_define_class_under_id(mrb, module_Net, MRB_SYM(DNS), mrb->object_class);
8787
mrb_define_class_method_id(mrb, class_Net_DNS, MRB_SYM(resolve), mrb_net_dns_s_resolve, MRB_ARGS_REQ(2));
8888

89-
struct RClass *class_Net_TCPClient = mrb_define_class_under_id(mrb, class_Net, MRB_SYM(TCPClient), mrb->object_class);
89+
struct RClass *class_Net_TCPClient = mrb_define_class_under_id(mrb, module_Net, MRB_SYM(TCPClient), mrb->object_class);
9090
mrb_define_class_method_id(mrb, class_Net_TCPClient, MRB_SYM(_request_impl), mrb_net_tcpclient_s__request_impl, MRB_ARGS_REQ(4));
9191

92-
struct RClass *class_Net_UDPClient = mrb_define_class_under_id(mrb, class_Net, MRB_SYM(UDPClient), mrb->object_class);
92+
struct RClass *class_Net_UDPClient = mrb_define_class_under_id(mrb, module_Net, MRB_SYM(UDPClient), mrb->object_class);
9393
mrb_define_class_method_id(mrb, class_Net_UDPClient, MRB_SYM(_send_impl), mrb_net_udpclient_s__send_impl, MRB_ARGS_REQ(4));
9494
}
9595
void

mrbgems/picoruby-net/src/mrubyc/net.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ c_net_udpclient__send_impl(mrbc_vm *vm, mrbc_value *v, int argc)
8484
void
8585
mrbc_net_init(mrbc_vm *vm)
8686
{
87-
mrbc_class *class_Net = mrbc_define_class(vm, "Net", mrbc_class_object);
87+
mrbc_class *module_Net = mrbc_define_module(vm, "Net");
8888

89-
mrbc_class *class_Net_DNS = mrbc_define_class_under(vm, class_Net, "DNS", mrbc_class_object);
89+
mrbc_class *class_Net_DNS = mrbc_define_class_under(vm, module_Net, "DNS", mrbc_class_object);
9090
mrbc_define_method(vm, class_Net_DNS, "resolve", c_net_dns_resolve);
9191

92-
mrbc_class *class_Net_TCPClient = mrbc_define_class_under(vm, class_Net, "TCPClient", mrbc_class_object);
92+
mrbc_class *class_Net_TCPClient = mrbc_define_class_under(vm, module_Net, "TCPClient", mrbc_class_object);
9393
mrbc_define_method(vm, class_Net_TCPClient, "_request_impl", c_net_tcpclient__request_impl);
9494

95-
mrbc_class *class_Net_UDPClient = mrbc_define_class_under(vm, class_Net, "UDPClient", mrbc_class_object);
95+
mrbc_class *class_Net_UDPClient = mrbc_define_class_under(vm, module_Net, "UDPClient", mrbc_class_object);
9696
mrbc_define_method(vm, class_Net_UDPClient, "_send_impl", c_net_udpclient__send_impl);
9797
}

0 commit comments

Comments
 (0)