Class: ICU4X::FormattedPart

Inherits:
Data
  • Object
show all
Defined in:
lib/icu4x.rb,
lib/icu4x.rb

Overview

Represents a part of a formatted string.

Used by format_to_parts methods in DateTimeFormat, NumberFormat, ListFormat, and RelativeTimeFormat.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeSymbol (readonly)

Returns The part type (e.g., :integer, :literal, :year).

Returns:

  • (Symbol)

    The part type (e.g., :integer, :literal, :year)



68
69
70
# File 'lib/icu4x.rb', line 68

def type
  @type
end

#valueString (readonly)

Returns The formatted value.

Returns:

  • (String)

    The formatted value



68
69
70
# File 'lib/icu4x.rb', line 68

def value
  @value
end

Instance Method Details

#inspectString

Returns Human-readable representation.

Returns:

  • (String)

    Human-readable representation



70
# File 'lib/icu4x.rb', line 70

def inspect = "#<ICU4X::FormattedPart type=#{type.inspect} value=#{value.inspect}>"