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.
89 90 91 92 |
# File 'lib/pod4/errors.rb', line 89 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.
83 84 85 |
# File 'lib/pod4/errors.rb', line 83 def field @field end |
Class Method Details
.from_alert(alert) ⇒ Object
85 86 87 |
# File 'lib/pod4/errors.rb', line 85 def self.from_alert(alert) self.new(alert., alert.field) end |