Class: TCellAgent::Instrumentation::ContextFilter
- Inherits:
-
Object
- Object
- TCellAgent::Instrumentation::ContextFilter
- Defined in:
- lib/tcell_agent/instrumentation.rb
Constant Summary collapse
- DATABASE =
'db'.freeze
- REQUEST =
'request'.freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#database ⇒ Object
Returns the value of attribute database.
-
#field ⇒ Object
Returns the value of attribute field.
-
#parameter ⇒ Object
Returns the value of attribute parameter.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#schema ⇒ Object
Returns the value of attribute schema.
-
#table ⇒ Object
Returns the value of attribute table.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #create_hash_value ⇒ Object
- #eql?(other) ⇒ Boolean
- #for_database(database, schema, table, field, rule) ⇒ Object
-
#for_request(context, parameter, rule) ⇒ Object
rubocop:disable Lint/DuplicateMethods.
- #hash ⇒ Object
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
14 15 16 |
# File 'lib/tcell_agent/instrumentation.rb', line 14 def context @context end |
#database ⇒ Object
Returns the value of attribute database.
16 17 18 |
# File 'lib/tcell_agent/instrumentation.rb', line 16 def database @database end |
#field ⇒ Object
Returns the value of attribute field.
19 20 21 |
# File 'lib/tcell_agent/instrumentation.rb', line 19 def field @field end |
#parameter ⇒ Object
Returns the value of attribute parameter.
15 16 17 |
# File 'lib/tcell_agent/instrumentation.rb', line 15 def parameter @parameter end |
#rule ⇒ Object
Returns the value of attribute rule.
13 14 15 |
# File 'lib/tcell_agent/instrumentation.rb', line 13 def rule @rule end |
#schema ⇒ Object
Returns the value of attribute schema.
17 18 19 |
# File 'lib/tcell_agent/instrumentation.rb', line 17 def schema @schema end |
#table ⇒ Object
Returns the value of attribute table.
18 19 20 |
# File 'lib/tcell_agent/instrumentation.rb', line 18 def table @table end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/tcell_agent/instrumentation.rb', line 12 def type @type end |
Instance Method Details
#create_hash_value ⇒ Object
32 33 34 |
# File 'lib/tcell_agent/instrumentation.rb', line 32 def create_hash_value "#{type}#{context}#{parameter}#{database}#{schema}#{table}#{field}#{rule}".hash end |
#eql?(other) ⇒ Boolean
36 37 38 |
# File 'lib/tcell_agent/instrumentation.rb', line 36 def eql?(other) hash == other.hash end |
#for_database(database, schema, table, field, rule) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/tcell_agent/instrumentation.rb', line 44 def for_database(database, schema, table, field, rule) self.type = ContextFilter::DATABASE self.database = database self.schema = schema self.table = table self.field = field self.rule = rule self end |
#for_request(context, parameter, rule) ⇒ Object
rubocop:disable Lint/DuplicateMethods
54 55 56 57 58 59 60 |
# File 'lib/tcell_agent/instrumentation.rb', line 54 def for_request(context, parameter, rule) self.type = ContextFilter::REQUEST self.context = context self.parameter = parameter self.rule = rule self end |
#hash ⇒ Object
40 41 42 |
# File 'lib/tcell_agent/instrumentation.rb', line 40 def hash create_hash_value end |