Class: Mkxms::Mssql::DmlTriggerHandler
Instance Method Summary
collapse
#handle_references_element
#handle_property_element
Constructor Details
Returns a new instance of DmlTriggerHandler.
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 62
def initialize(triggers, node)
a = node.attributes
@trigger = Trigger.new(
a['schema'],
a['name'],
a['timing'],
execute_as: a['execute_as'],
disabled: a['disabled'],
not_replicable: a['not-for-replication'],
).tap do |t|
store_properties_on t
triggers << t
end
end
|
Instance Method Details
#dependencies ⇒ Object
78
79
80
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 78
def dependencies
@trigger.dependencies
end
|
#handle_do_element(parse) ⇒ Object
92
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 92
def handle_do_element(parse); end
|
#handle_event_element(parse) ⇒ Object
87
88
89
90
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 87
def handle_event_element(parse)
a = parse.node.attributes
@trigger.events << a['type']
end
|
#handle_implementation_element(parse) ⇒ Object
This function handles a CLR implementation
102
103
104
105
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 102
def handle_implementation_element(parse)
a = parse.node.attributes
@trigger.clr_impl = ClrMethod.new(a['assembly'], a['class'], a['method'])
end
|
#handle_table_element(parse) ⇒ Object
82
83
84
85
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 82
def handle_table_element(parse)
a = parse.node.attributes
@trigger.table = Reference.new(a['schema'], a['name'])
end
|
#handle_text(text, parent_element) ⇒ Object
94
95
96
97
98
99
|
# File 'lib/mkxms/mssql/dml_trigger_handler.rb', line 94
def handle_text(text, parent_element)
case [parent_element.namespace, parent_element.name]
when ['', 'do']
@trigger.definition << text
end
end
|