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



36
37
38
# File 'lib/google/protobuf/message_exts.rb', line 36

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

Instance Method Details

#to_jsonObject



43
44
45
# File 'lib/google/protobuf/message_exts.rb', line 43

def to_json
  self.class.encode_json(self)
end

#to_protoObject



47
48
49
# File 'lib/google/protobuf/message_exts.rb', line 47

def to_proto
  self.class.encode(self)
end