Class: ActiveWindow::Controller
- Inherits:
-
Object
- Object
- ActiveWindow::Controller
show all
- Includes:
- Singleton
- Defined in:
- lib/active_window/controller.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
52
53
54
|
# File 'lib/active_window/controller.rb', line 52
def method_missing(name, *args, &block)
application.send name, *args, &block
end
|
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
6
7
8
|
# File 'lib/active_window/controller.rb', line 6
def application
@application
end
|
Instance Method Details
#app ⇒ Object
8
9
10
|
# File 'lib/active_window/controller.rb', line 8
def app
application
end
|
#controller ⇒ Object
16
17
18
|
# File 'lib/active_window/controller.rb', line 16
def controller
application.controller
end
|
#database ⇒ Object
24
25
26
|
# File 'lib/active_window/controller.rb', line 24
def database
application.database
end
|
#post_setup ⇒ Object
called on startup, after setup has been called for all controllers
33
34
|
# File 'lib/active_window/controller.rb', line 33
def post_setup
end
|
#pref_get(key) ⇒ Object
42
43
44
45
46
|
# File 'lib/active_window/controller.rb', line 42
def pref_get(key)
pref = Preference.find_by_pref(key)
return pref.value if pref
return nil
end
|
#pref_get_or_set(key, value) ⇒ Object
48
49
50
|
# File 'lib/active_window/controller.rb', line 48
def pref_get_or_set(key,value)
pref_get(key) || pref_set(key,value)
end
|
#pref_set(key, value) ⇒ Object
36
37
38
39
40
|
# File 'lib/active_window/controller.rb', line 36
def pref_set(key,value)
Preference.delete_all ['pref = ?', key]
Preference.create(:pref => key, :value => value)
value
end
|
#setup ⇒ Object
29
30
|
# File 'lib/active_window/controller.rb', line 29
def setup
end
|
12
13
14
|
# File 'lib/active_window/controller.rb', line 12
def widget(name)
application.widget(name)
end
|
#window ⇒ Object
20
21
22
|
# File 'lib/active_window/controller.rb', line 20
def window
application.window
end
|