Module: Anoubis::Data::Callbacks
- Included in:
- Anoubis::DataController
- Defined in:
- app/controllers/anoubis/data/callbacks.rb
Overview
Module presents all callbacks called in actions.
Instance Method Summary collapse
-
#after_create_data ⇒ Object
Fires after data was was created on the server and placed in self.output.data array.
-
#after_get_table_data ⇒ Object
Fires after data was received from server and placed in self.output.data array.
-
#after_update_data ⇒ Object
Fires after data was was updated on the server and placed in self.output.data array.
-
#around_output(data) ⇒ Object
Fires when data output to json value.
-
#before_create_data(data) ⇒ Hash
Fires after data was was created in self.output.data array and before it saved to server.
-
#before_output ⇒ Object
Fires right before output data to screen.
-
#before_update_data(data) ⇒ Hash
Fires before data will be verified and converted.
-
#destroy_data ⇒ Object
Fires when data is destroyed.
Instance Method Details
#after_create_data ⇒ Object
Fires after data was was created on the server and placed in self.output.data array. It’s rewrote for change data before output.
40 41 42 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 40 def after_create_data end |
#after_get_table_data ⇒ Object
Fires after data was received from server and placed in self.output.data array. It’s rewrote for change data before output.
9 10 11 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 9 def after_get_table_data end |
#after_update_data ⇒ Object
Fires after data was was updated on the server and placed in self.output.data array. It’s rewrote for change data before output.
24 25 26 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 24 def after_update_data end |
#around_output(data) ⇒ Object
Fires when data output to json value
52 53 54 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 52 def around_output(data) data end |
#before_create_data(data) ⇒ Hash
Fires after data was was created in self.output.data array and before it saved to server. It’s rewrote for change data before output.
33 34 35 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 33 def before_create_data(data) data end |
#before_output ⇒ Object
Fires right before output data to screen
46 47 48 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 46 def before_output end |
#before_update_data(data) ⇒ Hash
Fires before data will be verified and converted.
17 18 19 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 17 def before_update_data(data) data end |
#destroy_data ⇒ Object
Fires when data is destroyed
58 59 60 61 62 63 |
# File 'app/controllers/anoubis/data/callbacks.rb', line 58 def destroy_data if !self.etc.data.data.destroy self.output.errors.concat self.etc.data.data.errors. self.output.result = -4 end end |