Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ruby] Remove to_hash methods #6166

Merged
merged 1 commit into from Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion ruby/ext/google/protobuf_c/map.c
Expand Up @@ -847,7 +847,6 @@ void Map_register(VALUE module) {
rb_define_method(klass, "dup", Map_dup, 0);
rb_define_method(klass, "==", Map_eq, 1);
rb_define_method(klass, "hash", Map_hash, 0);
rb_define_method(klass, "to_hash", Map_to_h, 0);
rb_define_method(klass, "to_h", Map_to_h, 0);
rb_define_method(klass, "inspect", Map_inspect, 0);
rb_define_method(klass, "merge", Map_merge, 1);
Expand Down
1 change: 0 additions & 1 deletion ruby/ext/google/protobuf_c/message.c
Expand Up @@ -737,7 +737,6 @@ VALUE build_class_from_descriptor(Descriptor* desc) {
rb_define_method(klass, "eql?", Message_eq, 1);
rb_define_method(klass, "hash", Message_hash, 0);
rb_define_method(klass, "to_h", Message_to_h, 0);
rb_define_method(klass, "to_hash", Message_to_h, 0);
rb_define_method(klass, "inspect", Message_inspect, 0);
rb_define_method(klass, "to_s", Message_inspect, 0);
rb_define_method(klass, "[]", Message_index, 1);
Expand Down
2 changes: 1 addition & 1 deletion ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java
Expand Up @@ -338,7 +338,7 @@ public IRubyObject dup(ThreadContext context) {
return newMap;
}

@JRubyMethod(name = {"to_h", "to_hash"})
@JRubyMethod(name = "to_h")
public RubyHash toHash(ThreadContext context) {
return RubyHash.newHash(context.runtime, table, context.runtime.getNil());
}
Expand Down
Expand Up @@ -368,7 +368,7 @@ public static IRubyObject decodeJson(ThreadContext context, IRubyObject recv, IR
return ret;
}

@JRubyMethod(name = {"to_h", "to_hash"})
@JRubyMethod(name = "to_h")
public IRubyObject toHash(ThreadContext context) {
Ruby runtime = context.runtime;
RubyHash ret = RubyHash.newHash(runtime);
Expand Down