Class: JSONSkooma::Validators::Time
- Defined in:
- lib/json_skooma/validators/time.rb
Constant Summary collapse
- REGEXP =
/\A#{DateTime::FULL_TIME}\z/
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#call(data) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/json_skooma/validators/time.rb', line 8 def call(data) match = REGEXP.match(data) if match.nil? || !valid_leap_seconds?(match) raise FormatError, "must be a valid RFC 3339 time string" end end |