Class: Fluent::Plugin::JsonSizeLimit::RecordReducer::StringLocation
- Inherits:
-
JsonString
- Object
- JsonString
- Fluent::Plugin::JsonSizeLimit::RecordReducer::StringLocation
- Defined in:
- lib/fluent/plugin/json_size_limit/record_reducer.rb
Constant Summary
Constants inherited from JsonString
JsonString::COUNT_SCAN_THRESHOLD, JsonString::ESCAPED_CHARACTERS, JsonString::ESCAPE_REQUIRED, JsonString::UTF_8
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#occurrences ⇒ Object
Returns the value of attribute occurrences.
-
#original_value ⇒ Object
readonly
Returns the value of attribute original_value.
-
#replacement_content_bytes ⇒ Object
Returns the value of attribute replacement_content_bytes.
-
#replacement_value ⇒ Object
Returns the value of attribute replacement_value.
Attributes inherited from JsonString
#content_bytes, #truncated_content_bytes, #value
Instance Method Summary collapse
-
#initialize(container, key, value, encoding_validated: false) ⇒ StringLocation
constructor
A new instance of StringLocation.
- #truncate_to(content_budget) ⇒ Object
Methods inherited from JsonString
content_bytes, truncate, #truncate
Constructor Details
#initialize(container, key, value, encoding_validated: false) ⇒ StringLocation
Returns a new instance of StringLocation.
21 22 23 24 25 26 27 28 29 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 21 def initialize(container, key, value, encoding_validated: false) super(value, validate_encoding: !encoding_validated) @container = container @key = key @original_value = value @occurrences = 1 @replacement_value = value @replacement_content_bytes = content_bytes end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
18 19 20 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 18 def container @container end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
18 19 20 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 18 def key @key end |
#occurrences ⇒ Object
Returns the value of attribute occurrences.
19 20 21 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 19 def occurrences @occurrences end |
#original_value ⇒ Object (readonly)
Returns the value of attribute original_value.
18 19 20 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 18 def original_value @original_value end |
#replacement_content_bytes ⇒ Object
Returns the value of attribute replacement_content_bytes.
19 20 21 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 19 def replacement_content_bytes @replacement_content_bytes end |
#replacement_value ⇒ Object
Returns the value of attribute replacement_value.
19 20 21 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 19 def replacement_value @replacement_value end |
Instance Method Details
#truncate_to(content_budget) ⇒ Object
31 32 33 34 |
# File 'lib/fluent/plugin/json_size_limit/record_reducer.rb', line 31 def truncate_to(content_budget) @replacement_value = truncate(content_budget) @replacement_content_bytes = truncated_content_bytes end |