struct

Duration::Parser::ISO8601

Inherits Struct < Value < Object

The ISO8601 parser is an incredibly efficient, zero-allocation ISO8601 duration parser. It parses strings like "P3Y6M4DT12H30M5S" into Duration instances.

# 3 years, 6 months, 4 days, 12 hours, 30 minutes, 5.5 seconds
Duration.parse_iso8601("P3Y6M4DT12H30M5.5S")
# => Duration(@months=42, @days=4, @nanoseconds=45005500000000)

Constructors

Instance methods

initialize
Source
parse(string : String)
Source