Exception: Glossarist::InvalidLanguageCodeError

Inherits:
Error
  • Object
show all
Defined in:
lib/glossarist/error/invalid_language_code_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:) ⇒ InvalidLanguageCodeError

Returns a new instance of InvalidLanguageCodeError.



5
6
7
8
9
# File 'lib/glossarist/error/invalid_language_code_error.rb', line 5

def initialize(code:)
  @code = code

  super()
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/glossarist/error/invalid_language_code_error.rb', line 3

def code
  @code
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/glossarist/error/invalid_language_code_error.rb', line 11

def to_s
  "Invalid value for language_code: `#{code}`. It must be 3 characters long string."
end