Flowdock
v6.0.0 - Show latest stable - 0 notes - Superclass: Object

Parses a string formatted according to ISO 8601 Duration into the hash.

See ISO 8601 for more information.

This parser allows negative parts to be present in pattern.

Constants

TIME_COMPONENTS = [:hours, :minutes, :seconds]

DATE_COMPONENTS = [:years, :months, :days]

TIME_TO_PART = { "H" => :hours, "M" => :minutes, "S" => :seconds }

DATE_TO_PART = { "Y" => :years, "M" => :months, "W" => :weeks, "D" => :days }

TIME_COMPONENT = /(\-?\d+(?:[.,]\d+)?)(H|M|S)/

DATE_COMPONENT = /(\-?\d+(?:[.,]\d+)?)(Y|M|D|W)/

TIME_MARKER = /T/

DATE_MARKER = /P/

SIGN_MARKER = /\A\-|\+|/

COMMA = ","

PERIOD = "."

PERIOD_OR_COMMA = /\.|,/

Attributes

[RW] sign
[RW] mode
[R] scanner
[R] parts
Show files where this class is defined (1 file)
Register or log in to add new notes.