Exception: Pod4::ValidationError
- Defined in:
- lib/pod4/errors.rb
Overview
Raised if validation fails (and you wanted an exception…)
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message = nil, field = nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(message = nil, field = nil) ⇒ ValidationError
Returns a new instance of ValidationError.
75 76 77 78 |
# File 'lib/pod4/errors.rb', line 75 def initialize(=nil, field=nil) super( || $! && $!.) @field = field.to_s.to_sym end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
69 70 71 |
# File 'lib/pod4/errors.rb', line 69 def field @field end |
Class Method Details
.from_alert(alert) ⇒ Object
71 72 73 |
# File 'lib/pod4/errors.rb', line 71 def self.from_alert(alert) self.new(alert., alert.field) end |