Exception: NoBrainer::Error::DocumentInvalid

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/no_brainer/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance) ⇒ DocumentInvalid

Returns a new instance of DocumentInvalid.



22
23
24
# File 'lib/no_brainer/error.rb', line 22

def initialize(instance)
  @instance = instance
end

Instance Attribute Details

#instanceObject

Returns the value of attribute instance.



21
22
23
# File 'lib/no_brainer/error.rb', line 21

def instance
  @instance
end

Instance Method Details

#messageObject



26
27
28
# File 'lib/no_brainer/error.rb', line 26

def message
  "#{instance} is invalid: #{instance.errors.full_messages.join(", ")}"
end