Class: ICU4X::RelativeTimeFormat
- Inherits:
-
Object
- Object
- ICU4X::RelativeTimeFormat
- Defined in:
- lib/icu4x/yard_docs.rb
Overview
Formats relative time expressions (e.g., “3 days ago”, “in 2 hours”).
Instance Method Summary collapse
-
#format(value, unit) ⇒ String
Formats a relative time value.
-
#format_to_parts(value, unit) ⇒ Array<FormattedPart>
Formats a relative time value and returns an array of parts.
-
#initialize(locale, provider: nil, style: :long, numeric: :always) ⇒ RelativeTimeFormat
constructor
Creates a new RelativeTimeFormat instance.
-
#resolved_options ⇒ Hash
Returns the resolved options for this instance.
Constructor Details
#initialize(locale, provider: nil, style: :long, numeric: :always) ⇒ RelativeTimeFormat
Creates a new RelativeTimeFormat instance.
675 |
# File 'lib/icu4x/yard_docs.rb', line 675 def initialize(locale, provider: nil, style: :long, numeric: :always); end |
Instance Method Details
#format(value, unit) ⇒ String
Formats a relative time value.
688 |
# File 'lib/icu4x/yard_docs.rb', line 688 def format(value, unit); end |
#format_to_parts(value, unit) ⇒ Array<FormattedPart>
Note:
The current ICU4X experimental RelativeTimeFormatter does not provide separate part annotations for the numeric value. The entire formatted string is returned as a single ‘:literal` part.
Formats a relative time value and returns an array of parts.
708 |
# File 'lib/icu4x/yard_docs.rb', line 708 def format_to_parts(value, unit); end |
#resolved_options ⇒ Hash
Returns the resolved options for this instance.
717 |
# File 'lib/icu4x/yard_docs.rb', line 717 def ; end |