Remove Ruby to_hash methods

pull/6166/head
Mike Moore 6 years ago
parent 0c3f43a619
commit 565154af78
No known key found for this signature in database
GPG Key ID: DD7A8E4072BD187A
  1. 1
      ruby/ext/google/protobuf_c/map.c
  2. 1
      ruby/ext/google/protobuf_c/message.c
  3. 2
      ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java
  4. 2
      ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java

@ -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);

@ -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);

@ -338,7 +338,7 @@ public class RubyMap extends RubyObject {
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());
}

@ -368,7 +368,7 @@ public class RubyMessage extends RubyObject {
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);

Loading…
Cancel
Save