Module: Google::Protobuf::MessageExts

Defined in:
lib/google/protobuf/message_exts.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

this is only called in jruby; mri loades the ClassMethods differently



13
14
15
# File 'lib/google/protobuf/message_exts.rb', line 13

def self.included(klass)
  klass.extend(ClassMethods)
end

Instance Method Details

#to_json(options = {}) ⇒ Object



20
21
22
# File 'lib/google/protobuf/message_exts.rb', line 20

def to_json(options = {})
  self.class.encode_json(self, options)
end

#to_proto(options = {}) ⇒ Object



24
25
26
# File 'lib/google/protobuf/message_exts.rb', line 24

def to_proto(options = {})
  self.class.encode(self, options)
end