Class: OpenCensus::Trace::TruncatableString
- Inherits:
-
Object
- Object
- OpenCensus::Trace::TruncatableString
- Defined in:
- lib/opencensus/trace/truncatable_string.rb
Overview
A string that might be shortened to a specified length.
Instance Attribute Summary collapse
-
#truncated_byte_count ⇒ Integer
readonly
The number of bytes removed from the original string.
-
#value ⇒ String
readonly
The shortened string.
Instance Attribute Details
#truncated_byte_count ⇒ Integer (readonly)
The number of bytes removed from the original string. If this value is 0, then the string was not shortened.
40 41 42 |
# File 'lib/opencensus/trace/truncatable_string.rb', line 40 def truncated_byte_count @truncated_byte_count end |
#value ⇒ String (readonly)
The shortened string. For example, if the original string was 500 bytes long and the limit of the string was 128 bytes, then this value contains the first 128 bytes of the 500-byte string. Note that truncation always happens on a character boundary, to ensure that a truncated string is still valid UTF-8. Because it may contain multi-byte characters, the size of the truncated string may be less than the truncation limit.
32 33 34 |
# File 'lib/opencensus/trace/truncatable_string.rb', line 32 def value @value end |