Exception: Jschematic::ValidationError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(what, expected, actual) ⇒ ValidationError

Returns a new instance of ValidationError.



5
6
7
# File 'lib/jschematic/exceptions.rb', line 5

def initialize(what, expected, actual)
  @what, @expected, @actual = what, expected, actual
end

Instance Attribute Details

#actualObject (readonly)

Returns the value of attribute actual.



3
4
5
# File 'lib/jschematic/exceptions.rb', line 3

def actual
  @actual
end

#expectedObject (readonly)

Returns the value of attribute expected.



3
4
5
# File 'lib/jschematic/exceptions.rb', line 3

def expected
  @expected
end

#whatObject (readonly)

Returns the value of attribute what.



3
4
5
# File 'lib/jschematic/exceptions.rb', line 3

def what
  @what
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/jschematic/exceptions.rb', line 9

def to_s
  "#{what} expected #{expected} but found #{actual}"
end