Class: Anoubis::Etc::Base
- Inherits:
-
Object
- Object
- Anoubis::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.
-
#version ⇒ Number
Returns API version received from URL.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
Sets default system parameters.
Constructor Details
#initialize(options = {}) ⇒ Base
Sets default system parameters
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/anoubis/etc/base.rb', line 40 def initialize( = {}) self.data = nil self. = nil self.tab = nil self.action = '' self.time = 0 self.version = 0 if .key? :params self.action = [:params][:action] if [:params].key? :action self.time = [:params][:time].to_s.to_i if [:params].key? :time self.version = [:params][:version].to_s.to_i if [:params].key? :version end end |
Instance Attribute Details
#action ⇒ String
Returns current controller action. By default sets to controller action or ”.
24 25 26 |
# File 'app/controllers/anoubis/etc/base.rb', line 24 def action @action end |
#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 10 11 |
# File 'app/controllers/anoubis/etc/base.rb', line 9 def data @data end |
#menu ⇒ Menu?
Returns menu information for current controller. By default sets to nil.
14 15 16 |
# File 'app/controllers/anoubis/etc/base.rb', line 14 def @menu end |
#tab ⇒ TabItem?
Returns tab information for current controller. By default sets to nil.
19 20 21 |
# File 'app/controllers/anoubis/etc/base.rb', line 19 def tab @tab end |
#time ⇒ Number
Returns time that was requested from client. By default sets to 0.
29 30 31 |
# File 'app/controllers/anoubis/etc/base.rb', line 29 def time @time end |
#version ⇒ Number
Returns API version received from URL. By default sets to 0.
34 35 36 |
# File 'app/controllers/anoubis/etc/base.rb', line 34 def version @version end |