Module: Momentum::ViewControllerModule
- Included in:
- ViewController
- Defined in:
- lib/motion-momentum-ios/controller/view_controller_module.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#class_title ⇒ Object
Returns the value of attribute class_title.
-
#delegate ⇒ Object
Returns the value of attribute delegate.
-
#delegate_class ⇒ Object
Returns the value of attribute delegate_class.
-
#stylesheet_class ⇒ Object
Returns the value of attribute stylesheet_class.
-
#view_class ⇒ Object
Returns the value of attribute view_class.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#class_title ⇒ Object
Returns the value of attribute class_title.
28 29 30 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 28 def class_title @class_title end |
#delegate ⇒ Object
Returns the value of attribute delegate.
28 29 30 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 28 def delegate @delegate end |
#delegate_class ⇒ Object
Returns the value of attribute delegate_class.
28 29 30 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 28 def delegate_class @delegate_class end |
#stylesheet_class ⇒ Object
Returns the value of attribute stylesheet_class.
28 29 30 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 28 def stylesheet_class @stylesheet_class end |
#view_class ⇒ Object
Returns the value of attribute view_class.
28 29 30 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 28 def view_class @view_class end |
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 4 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#init ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 30 def init super self.view_class = ('View') self.delegate_class = ('Delegate') self.stylesheet_class = ('Stylesheet') self end |
#loadView ⇒ Object
38 39 40 41 42 43 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 38 def loadView self.view = self.view_class.new self.delegate = self.delegate_class.new self.view.delegate = self.delegate if self.view.class.instance_methods.include?(:delegate) self.view.dataSource = self.delegate if self.view.class.instance_methods.include?(:dataSource) end |
#title ⇒ Object
49 50 51 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 49 def title super || class_title end |
#viewWillAppear(animated) ⇒ Object
45 46 47 |
# File 'lib/motion-momentum-ios/controller/view_controller_module.rb', line 45 def viewWillAppear(animated) self.setup if self.class.instance_methods.include?(:setup) end |