Exception: Bureaucrat::ValidationError
- Inherits:
-
Exception
- Object
- Exception
- Bureaucrat::ValidationError
- Defined in:
- lib/bureaucrat.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(message, code = nil, params = nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, code = nil, params = nil) ⇒ ValidationError
Returns 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
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/bureaucrat.rb', line 5 def code @code end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
5 6 7 |
# File 'lib/bureaucrat.rb', line 5 def @messages end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/bureaucrat.rb', line 5 def params @params end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/bureaucrat.rb', line 17 def to_s "ValidationError(#{@messages.inspect})" end |