Class: LogStash::Filters::Jdbc::LookupResult

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/jdbc/lookup_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLookupResult

Returns a new instance of LookupResult.



6
7
8
9
10
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 6

def initialize
  @failure = false
  @payload = []
  @invalid_parameters = []
end

Instance Attribute Details

#invalid_parametersObject (readonly)

Returns the value of attribute invalid_parameters.



4
5
6
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 4

def invalid_parameters
  @invalid_parameters
end

#payloadObject (readonly)

Returns the value of attribute payload.



4
5
6
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 4

def payload
  @payload
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 36

def empty?
  @payload.empty?
end

#failed!Object



20
21
22
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 20

def failed!
  @failure = true
end

#failed?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 28

def failed?
  @failure
end

#invalid_parameters_push(data) ⇒ Object



16
17
18
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 16

def invalid_parameters_push(data)
  @invalid_parameters << data
end

#parameters_invalid?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 32

def parameters_invalid?
  !@invalid_parameters.empty?
end

#push(data) ⇒ Object



12
13
14
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 12

def push(data)
  @payload << data
end

#valid?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/logstash/filters/jdbc/lookup_result.rb', line 24

def valid?
  !failed? && @invalid_parameters.empty?
end