Class: Moon::Validator::Format
- Inherits:
-
Object
- Object
- Moon::Validator::Format
- Defined in:
- lib/moon/validator/format.rb
Overview
Value format validator.
Instance Method Summary collapse
-
#initialize(format) ⇒ Format
constructor
A new instance of Format.
- #messages(value, context) ⇒ Object
Constructor Details
#initialize(format) ⇒ Format
Returns a new instance of Format.
5 6 7 |
# File 'lib/moon/validator/format.rb', line 5 def initialize(format) @format = format end |
Instance Method Details
#messages(value, context) ⇒ Object
9 10 11 |
# File 'lib/moon/validator/format.rb', line 9 def (value, context) value =~ @format ? [ ] : [ "Has a wrong format." ] end |