Exception: Shoulda::Matchers::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/shoulda/matchers/error.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Error

Returns a new instance of Error.



15
16
17
18
# File 'lib/shoulda/matchers/error.rb', line 15

def initialize(*args)
  super
  @message = message
end

Class Method Details

.create(attributes) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/shoulda/matchers/error.rb', line 5

def self.create(attributes)
  allocate.tap do |error|
    attributes.each do |name, value|
      error.__send__("#{name}=", value)
    end

    error.__send__(:initialize)
  end
end

Instance Method Details

#inspectObject



24
25
26
# File 'lib/shoulda/matchers/error.rb', line 24

def inspect
  %(#<#{self.class}: #{message}>)
end

#messageObject



20
21
22
# File 'lib/shoulda/matchers/error.rb', line 20

def message
  ''
end