Class: Rgtk::Controller::Base
- Inherits:
-
Object
- Object
- Rgtk::Controller::Base
show all
- Extended by:
- DSL
- Defined in:
- lib/rgtk/controller/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from DSL
on, shortcuts, signals_for
Constructor Details
#initialize ⇒ Base
19
20
21
22
|
# File 'lib/rgtk/controller/base.rb', line 19
def initialize
@_controller_name ||= self.class.controller_name
load_objects
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/rgtk/controller/base.rb', line 32
def method_missing(method_name, *args)
if @_children.key?(method_name)
self[method_name]
else
super(method_name, *args)
end
end
|
Instance Attribute Details
#builder=(value) ⇒ Object
Sets the attribute builder
5
6
7
|
# File 'lib/rgtk/controller/base.rb', line 5
def builder=(value)
@builder = value
end
|
#objects ⇒ Object
Returns the value of attribute objects.
5
6
7
|
# File 'lib/rgtk/controller/base.rb', line 5
def objects
@objects
end
|
Class Method Details
.controller_name ⇒ Object
7
8
9
|
# File 'lib/rgtk/controller/base.rb', line 7
def self.controller_name
self.name.underscore.sub(/_controller$/, '')
end
|
Instance Method Details
#[](object_name) ⇒ Object
28
29
30
|
# File 'lib/rgtk/controller/base.rb', line 28
def [](object_name)
@_children[object_name.to_s]
end
|
#controller_name ⇒ Object
11
12
13
|
# File 'lib/rgtk/controller/base.rb', line 11
def controller_name
@_controller_name
end
|
#controller_name=(name) ⇒ Object
15
16
17
|
# File 'lib/rgtk/controller/base.rb', line 15
def controller_name=(name)
@_controller_name = name
end
|
#run ⇒ Object
24
25
26
|
# File 'lib/rgtk/controller/base.rb', line 24
def run
container.show
end
|