Exception: Bureaucrat::ValidationError
- Inherits:
-
Exception
- Object
- Exception
- Bureaucrat::ValidationError
- Defined in:
- lib/bureaucrat.rb
Instance Attribute Summary (collapse)
-
- (Object) code
readonly
Returns the value of attribute code.
-
- (Object) messages
readonly
Returns the value of attribute messages.
-
- (Object) params
readonly
Returns the value of attribute params.
Instance Method Summary (collapse)
-
- (ValidationError) initialize(message, code = nil, params = nil)
constructor
A new instance of ValidationError.
- - (Object) to_s
Constructor Details
- (ValidationError) initialize(message, code = nil, params = nil)
A new instance of ValidationError
7 8 9 10 11 12 13 14 15 |
# File 'lib/bureaucrat.rb', line 7 def initialize(, code = nil, params = nil) if .is_a? Array @messages = else @code = code @params = params @messages = [] end end |
Instance Attribute Details
- (Object) code (readonly)
Returns the value of attribute code
5 6 7 |
# File 'lib/bureaucrat.rb', line 5 def code @code end |
- (Object) messages (readonly)
Returns the value of attribute messages
5 6 7 |
# File 'lib/bureaucrat.rb', line 5 def @messages end |
- (Object) params (readonly)
Returns the value of attribute params
5 6 7 |
# File 'lib/bureaucrat.rb', line 5 def params @params end |
Instance Method Details
- (Object) to_s
17 18 19 |
# File 'lib/bureaucrat.rb', line 17 def to_s "ValidationError(#{@messages.inspect})" end |