Module: Anubis::Core::Data::Set
- Included in:
- Anubis::Core::DataController, Sso::Client::Data::Set, Tenant::Data::Set
- Defined in:
- app/controllers/anoubis/core/data/set.rb
Overview
Module sets system data for Anubis::Core::DataController
Instance Method Summary collapse
-
#set_current_tab ⇒ Object
Gets tab for current controller and place it into self.etc.tab system variable.
-
#set_new_action(action) ⇒ Object
Defines new action and clears defined for old action variables.
-
#set_parent_model(action = '') ⇒ Object
Sets parent model according by type.
Instance Method Details
#set_current_tab ⇒ Object
Gets tab for current controller and place it into self.etc.tab system variable. If params absent or incorrect then self.etc.tab is set as first value of Defaults#tabs hash.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/anoubis/core/data/set.rb', line 25 def set_current_tab if !self.etc.tab tabs = self.tabs if params.key? :tab if params[:tab].to_s != '' if tabs.key? params[:tab].to_s.to_sym self.etc.tab = Etc::TabItem.new(self.get_tab(params[:tab].to_s, tabs[params[:tab].to_s.to_sym])) end end end self.etc.tab = Etc::TabItem.new(self.get_tab(tabs.keys[0].to_s, tabs.values[0])) if !self.etc.tab end end |
#set_new_action(action) ⇒ Object
Defines new action and clears defined for old action variables
42 43 44 45 |
# File 'app/controllers/anoubis/core/data/set.rb', line 42 def set_new_action(action) self.etc.action = action self.etc.data.model = nil end |
#set_parent_model(action = '') ⇒ Object
Sets parent model according by type. Resulting data placed in self.etc.data.parent
16 17 18 19 20 |
# File 'app/controllers/anoubis/core/data/set.rb', line 16 def set_parent_model(action = '') self.etc.data = Anubis::Etc::Data.new if !self.etc.data self.etc.action = action if action != '' self.set_current_tab end |