Exception: Yapo::Helpers::CustomErrors::SyntaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/yapo/helpers/custom_errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception = nil) ⇒ SyntaxError

Returns a new instance of SyntaxError.



33
34
35
36
# File 'lib/yapo/helpers/custom_errors.rb', line 33

def initialize(exception = nil)
  @original = exception
  ErrorMessage.new.print(message)
end

Instance Attribute Details

#originalObject (readonly)

Returns the value of attribute original.



31
32
33
# File 'lib/yapo/helpers/custom_errors.rb', line 31

def original
  @original
end

Instance Method Details

#messageObject



38
39
40
41
# File 'lib/yapo/helpers/custom_errors.rb', line 38

def message
  "You have a syntax error in your .yapo.yml file.\n" \
  "#{@original}\n"
end