Class: TCellAgent::SensorEvents::DiscoveryEvent
- Inherits:
-
TCellSensorEvent
- Object
- Hash
- TCellSensorEvent
- TCellAgent::SensorEvents::DiscoveryEvent
- Defined in:
- lib/tcell_agent/sensor_events/discovery.rb
Constant Summary collapse
- DATABASE_TYPE =
'db'.freeze
Instance Attribute Summary
Attributes inherited from TCellSensorEvent
Instance Method Summary collapse
- #for_database(database, schema, table, field) ⇒ Object
- #for_database_fields(database, schema, table, fields) ⇒ Object
-
#initialize(route_id = nil) ⇒ DiscoveryEvent
constructor
A new instance of DiscoveryEvent.
Methods inherited from TCellSensorEvent
#bucket_key, #calculate_offset
Constructor Details
#initialize(route_id = nil) ⇒ DiscoveryEvent
Returns a new instance of DiscoveryEvent.
7 8 9 10 |
# File 'lib/tcell_agent/sensor_events/discovery.rb', line 7 def initialize(route_id = nil) super('discovery') self['rid'] = route_id if route_id end |
Instance Method Details
#for_database(database, schema, table, field) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/tcell_agent/sensor_events/discovery.rb', line 12 def for_database(database, schema, table, field) self['type'] = 'db' self['db'] = database self['schema'] = schema self['table'] = table self['field'] = field end |
#for_database_fields(database, schema, table, fields) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/tcell_agent/sensor_events/discovery.rb', line 20 def for_database_fields(database, schema, table, fields) self['type'] = 'db' self['db'] = database self['schema'] = schema self['table'] = table self['fields'] = fields self end |