Class: Anubis::Etc::Base
- Inherits:
-
Object
- Object
- Anubis::Etc::Base
- Defined in:
- app/controllers/anoubis/etc/base.rb
Overview
Basic system variables class
Instance Attribute Summary collapse
-
#action ⇒ String
Returns current controller action.
-
#data ⇒ Data?
Current loaded data or nil if data not loaded.
-
#menu ⇒ Menu?
Returns menu information for current controller.
-
#tab ⇒ TabItem?
Returns tab information for current controller.
-
#time ⇒ Number
Returns time that was requested from client.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
Sets default system parameters.
Constructor Details
#initialize(options = {}) ⇒ Base
Sets default system parameters
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/anoubis/etc/base.rb', line 35 def initialize( = {}) self.data = nil self. = nil self.tab = nil self.action = '' if .key? :params self.action = [:params][:action] if [:params].key? :action if [:params].key? :time self.time = [:params][:time].to_s.to_i else self.time = 0 end end end |
Instance Attribute Details
#action ⇒ String
Returns current controller action. By default sets to controller action or ''.
24 |
# File 'app/controllers/anoubis/etc/base.rb', line 24 class_attribute :action, default: '' |
#data ⇒ Data?
In this attribute placed data when loaded from the model by actions 'table', 'edit', 'update', 'create' etc.
Returns current loaded data or nil if data not loaded.
9 |
# File 'app/controllers/anoubis/etc/base.rb', line 9 class_attribute :data |
#menu ⇒ Menu?
Returns menu information for current controller. By default sets to nil.
14 |
# File 'app/controllers/anoubis/etc/base.rb', line 14 class_attribute :menu, default: nil |
#tab ⇒ TabItem?
Returns tab information for current controller. By default sets to nil.
19 |
# File 'app/controllers/anoubis/etc/base.rb', line 19 class_attribute :tab, default: nil |
#time ⇒ Number
Returns time that was requested from client. By default sets to 0.
29 |
# File 'app/controllers/anoubis/etc/base.rb', line 29 class_attribute :time, default: 0 |