Class: Validation::Error
- Inherits:
-
Object
- Object
- Validation::Error
- Defined in:
- lib/validation/error.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
-
#initialize(field, message) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(field, message) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/validation/error.rb', line 5 def initialize(field, ) @field = field @message = end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
3 4 5 |
# File 'lib/validation/error.rb', line 3 def field @field end |
Instance Method Details
#message ⇒ Object
10 11 12 |
# File 'lib/validation/error.rb', line 10 def @message.gsub(':field', @field) end |