Class: Lingo24::Exception

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lingo24/exception.rb

Overview

Custom Exception class for errors returned from the Lingo24 Translation APIs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, msg) ⇒ Exception

Creates a new Language.

Parameters: code - a string containing the status code of the message. msg - a string containing the exception message.



12
13
14
15
# File 'lib/lingo24/exception.rb', line 12

def initialize(code, msg)
  @code = code
  @message = msg
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



5
6
7
# File 'lib/lingo24/exception.rb', line 5

def code
  @code
end

Instance Method Details

#messageObject

Overrides default message to return the exception’s message.



18
19
20
# File 'lib/lingo24/exception.rb', line 18

def message
 @message
end