class Lebowski::Foundation::UnexpectedTypeError

Public Class Methods

new(path, expected_type, result_type, value) click to toggle source
Calls superclass method
# File lib/lebowski/foundation/errors/unexpected_type.rb, line 11
def initialize(path, expected_type, result_type, value)
  
  if value.kind_of?(Lebowski::Foundation::SCObject)
    value = value.sc_class
  end
  
  if expected_type.kind_of?(Class) and expected_type.ancestors.member?(Lebowski::Foundation::SCObject)
    expected_type = expected_type.represented_sc_class
  end
  
  message = "Did not get expected type '#{expected_type}' for path '#{path}'. Instead got #{result_type}: #{value}"
  
  super(message)
  
end