Flowdock
Ruby on Rails latest stable (v5.2.3) - 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 = ",".freeze

PERIOD = ".".freeze

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.