Exception: Protobuf::ActiveRecord::MessageNotDefined

Inherits:
ProtobufActiveRecordError show all
Defined in:
lib/protobuf/active_record/errors.rb

Overview

Raised by ‘to_proto` when no protobuf message is defined.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ MessageNotDefined

Returns a new instance of MessageNotDefined.



29
30
31
# File 'lib/protobuf/active_record/errors.rb', line 29

def initialize(klass)
  @class_name = klass.name
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



27
28
29
# File 'lib/protobuf/active_record/errors.rb', line 27

def class_name
  @class_name
end

Instance Method Details

#messageObject



33
34
35
# File 'lib/protobuf/active_record/errors.rb', line 33

def message
  "#{class_name} does not define a protobuf message"
end