1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/lib/shoulda/matchers/error.rb

29 lines
517 B
Ruby

module Shoulda
module Matchers
# @private
class Error < StandardError
def self.create(attributes)
allocate.tap do |error|
attributes.each do |name, value|
error.__send__("#{name}=", value)
end
error.__send__(:initialize)
end
end
def initialize(*args)
super
@message = message
end
def message
''
end
def inspect
%(#<#{self.class}: #{message}>)
end
end
end
end