Class: StructuredReader::JSONReader::TimeReader
- Inherits:
-
StringReader
- Object
- StringReader
- StructuredReader::JSONReader::TimeReader
- Defined in:
- lib/structured_reader.rb
Instance Method Summary collapse
Methods inherited from StringReader
Constructor Details
This class inherits a constructor from StructuredReader::JSONReader::StringReader
Instance Method Details
#maybe_parse(fragment, context) ⇒ Object
200 201 202 203 204 205 206 |
# File 'lib/structured_reader.rb', line 200 def maybe_parse(fragment, context) begin context.accept DateTime.parse(fragment) rescue ArgumentError context.flunk(fragment, "could not be converted to a DateTime") end end |