Exception: Angus::SDoc::InvalidServiceMessage

Inherits:
StandardError
  • Object
show all
Defined in:
lib/angus/exceptions/invalid_service_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_key, error_message) ⇒ InvalidServiceMessage

Returns a new instance of InvalidServiceMessage.



8
9
10
11
# File 'lib/angus/exceptions/invalid_service_message.rb', line 8

def initialize(message_key, error_message)
  self.error_message= error_message
  self.message_key= message_key
end

Instance Attribute Details

#error_messageObject

Returns the value of attribute error_message.



6
7
8
# File 'lib/angus/exceptions/invalid_service_message.rb', line 6

def error_message
  @error_message
end

#message_keyObject

Returns the value of attribute message_key.



6
7
8
# File 'lib/angus/exceptions/invalid_service_message.rb', line 6

def message_key
  @message_key
end

Instance Method Details

#==(other) ⇒ Object



25
26
27
28
# File 'lib/angus/exceptions/invalid_service_message.rb', line 25

def == (other)
  other.kind_of?(InvalidServiceMessage) &&
    other.message == self.message && self.message_key == other.message_key
end

#error_keyObject



13
14
15
# File 'lib/angus/exceptions/invalid_service_message.rb', line 13

def error_key
  self.class.name
end

#messageObject



17
18
19
# File 'lib/angus/exceptions/invalid_service_message.rb', line 17

def message
  "#@message_key => #@error_message"
end

#to_sObject



21
22
23
# File 'lib/angus/exceptions/invalid_service_message.rb', line 21

def to_s
  message
end