class LogStash::Filters::MathCalculationElements::RegisterElement
Public Class Methods
new(reference, position, index)
click to toggle source
supports `get` and `set`
# File lib/logstash/filters/math_calculation_elements.rb, line 31 def initialize(reference, position, index) @reference = reference @position = position @index = index @description = (position == 3 ? "#{@index}" : "operand #{@position}").prepend("register ").concat(": '#{@reference}'") end
Public Instance Methods
get(event_register_context)
click to toggle source
# File lib/logstash/filters/math_calculation_elements.rb, line 51 def get(event_register_context) event_register_context.get(self) #log warning if nil end
inspect()
click to toggle source
# File lib/logstash/filters/math_calculation_elements.rb, line 55 def inspect "\"#{@description}\"" end
key()
click to toggle source
# File lib/logstash/filters/math_calculation_elements.rb, line 38 def key @index end
literal?()
click to toggle source
# File lib/logstash/filters/math_calculation_elements.rb, line 42 def literal? false end
set(value, event_register_context)
click to toggle source
# File lib/logstash/filters/math_calculation_elements.rb, line 46 def set(value, event_register_context) # raise usage error if called when position != 3 ?? event_register_context.set(self, value) end
to_s()
click to toggle source
# File lib/logstash/filters/math_calculation_elements.rb, line 59 def to_s @description end