Exception: Crowdin::Errors::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/crowdin-api/core/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, error_code, error_message) ⇒ Error

Returns a new instance of Error.



8
9
10
11
12
13
# File 'lib/crowdin-api/core/errors.rb', line 8

def initialize(key, error_code, error_message)
  @key           = key
  @error_code    = error_code.to_i
  @error_message = error_message
  @message       = "#{key} => #{error_code}: #{error_message}"
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



6
7
8
# File 'lib/crowdin-api/core/errors.rb', line 6

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



6
7
8
# File 'lib/crowdin-api/core/errors.rb', line 6

def error_message
  @error_message
end

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/crowdin-api/core/errors.rb', line 6

def key
  @key
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/crowdin-api/core/errors.rb', line 15

def to_s
  @message
end