Module: DataMapper::Cutie::Tracker::Hook::Abstract::ClassMethods

Defined in:
lib/dm-cutie/tracker/hook/abstract.rb

Instance Method Summary collapse

Instance Method Details

#hook_nameString

  • hook_name - The name of your hook

Returns:

  • (String)

Raises:

  • (Exception)


47
48
49
# File 'lib/dm-cutie/tracker/hook/abstract.rb', line 47

def hook_name
  raise Exception, "#{self.class}.hook_name was not implemented"
end

#supported_adaptersArray[Symbol]

  • supported_adapters - List of adapters that will use this hook

Examples:

[ :mysql, :sqlite3 ]

Returns:

  • (Array[Symbol])

Raises:

  • (Exception)


29
30
31
# File 'lib/dm-cutie/tracker/hook/abstract.rb', line 29

def supported_adapters
  raise Exception, "#{self.class}.supported_adapters was not implemented"
end

#supported_statementsArray[Symbol]

  • supported_statements - Statements supported by this tracker hook

Examples:

[:delete]

Returns:

  • (Array[Symbol])


18
19
20
# File 'lib/dm-cutie/tracker/hook/abstract.rb', line 18

def supported_statements
  [:select, :insert, :update, :delete]
end

#track(executed_query) ⇒ Object

  • track - Factory method that is called to start your hook

return [NilClass]

Parameters:

Raises:

  • (Exception)


39
40
41
# File 'lib/dm-cutie/tracker/hook/abstract.rb', line 39

def track( executed_query )
  raise Exception, "#{self.class}.track was not implemented"
end