Class: Fluent::RedisCounterOutput::RecordValueFormatter
- Inherits:
-
Object
- Object
- Fluent::RedisCounterOutput::RecordValueFormatter
- Defined in:
- lib/fluent/plugin/out_redis_counter.rb
Constant Summary collapse
- CUSTOM_KEY_EXPRESSION_RE =
/(%_\{([^\}]+)\})/
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Instance Method Summary collapse
-
#initialize(format) ⇒ RecordValueFormatter
constructor
A new instance of RecordValueFormatter.
- #key(record) ⇒ Object
Constructor Details
#initialize(format) ⇒ RecordValueFormatter
Returns a new instance of RecordValueFormatter.
82 83 84 |
# File 'lib/fluent/plugin/out_redis_counter.rb', line 82 def initialize(format) @format = format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
81 82 83 |
# File 'lib/fluent/plugin/out_redis_counter.rb', line 81 def format @format end |
Instance Method Details
#key(record) ⇒ Object
88 89 90 91 92 |
# File 'lib/fluent/plugin/out_redis_counter.rb', line 88 def key(record) @format.gsub(CUSTOM_KEY_EXPRESSION_RE) do |s| record[$2] end end |