Module: MotionPrime::ScreenBaseMixin
- Extended by:
- MotionSupport::Concern
- Includes:
- ScreenAliasesMixin, ScreenNavigationMixin, ScreenOrientationsMixin, ScreenSectionsMixin, MotionSupport::Callbacks
- Included in:
- Screen
- Defined in:
- motion-prime/screens/_base_mixin.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#modal ⇒ Object
Returns the value of attribute modal.
-
#options ⇒ Object
Returns the value of attribute options.
-
#params ⇒ Object
Returns the value of attribute params.
-
#parent_screen ⇒ Object
Returns the value of attribute parent_screen.
-
#tab_bar ⇒ Object
Returns the value of attribute tab_bar.
Attributes included from ScreenSectionsMixin
Instance Method Summary collapse
- #action?(action) ⇒ Boolean
- #app_delegate ⇒ Object
-
#content_controller ⇒ Object
Return content controller (without sidebar).
-
#main_controller ⇒ Object
Return the main controller.
- #modal? ⇒ Boolean
-
#on_create(options = {}) ⇒ MotionPrime::Screen
Setup the screen, this method will be called when you run MPViewController.new.
- #title ⇒ Object
- #title=(new_title) ⇒ Object (also: #set_title)
Methods included from ScreenSectionsMixin
#all_sections, #all_sections_with_main, included, #main_section, #refresh, #set_section, #set_sections_wrapper
Methods included from HasNormalizer
#debug_info, #element?, #normalize_object, #normalize_options, #normalize_value
Methods included from HasClassFactory
#camelize_factory, #class_factory, #low_camelize_factory
Methods included from ScreenNavigationMixin
#back, #close_screen, #has_navigation?, #navigation_controller, #navigation_controller=, #open_screen, #send_on_leave, #send_on_return, #wrap_in_navigation, #wrap_in_navigation?
Methods included from ScreenOrientationsMixin
#should_rotate, #supported_orientation?, #supported_orientations
Methods included from ScreenAliasesMixin
#on_appear, #on_disappear, #on_rotate, #should_autorotate, #view_did_appear, #view_did_disappear, #view_did_load, #view_will_appear, #view_will_disappear, #will_appear, #will_disappear, #will_rotate
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
15 16 17 |
# File 'motion-prime/screens/_base_mixin.rb', line 15 def action @action end |
#modal ⇒ Object
Returns the value of attribute modal.
15 16 17 |
# File 'motion-prime/screens/_base_mixin.rb', line 15 def modal @modal end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'motion-prime/screens/_base_mixin.rb', line 15 def @options end |
#params ⇒ Object
Returns the value of attribute params.
15 16 17 |
# File 'motion-prime/screens/_base_mixin.rb', line 15 def params @params end |
#parent_screen ⇒ Object
Returns the value of attribute parent_screen.
15 16 17 |
# File 'motion-prime/screens/_base_mixin.rb', line 15 def parent_screen @parent_screen end |
#tab_bar ⇒ Object
Returns the value of attribute tab_bar.
15 16 17 |
# File 'motion-prime/screens/_base_mixin.rb', line 15 def @tab_bar end |
Instance Method Details
#action?(action) ⇒ Boolean
42 43 44 |
# File 'motion-prime/screens/_base_mixin.rb', line 42 def action?(action) self.action == action.to_s end |
#app_delegate ⇒ Object
18 19 20 |
# File 'motion-prime/screens/_base_mixin.rb', line 18 def app_delegate UIApplication.sharedApplication.delegate end |
#content_controller ⇒ Object
Return content controller (without sidebar)
68 69 70 |
# File 'motion-prime/screens/_base_mixin.rb', line 68 def content_controller self end |
#main_controller ⇒ Object
Return the main controller.
63 64 65 |
# File 'motion-prime/screens/_base_mixin.rb', line 63 def main_controller ? : self end |
#modal? ⇒ Boolean
46 47 48 |
# File 'motion-prime/screens/_base_mixin.rb', line 46 def modal? !!self.modal end |
#on_create(options = {}) ⇒ MotionPrime::Screen
Setup the screen, this method will be called when you run MPViewController.new
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'motion-prime/screens/_base_mixin.rb', line 29 def on_create( = {}) unless self.is_a?(UIViewController) raise StandardError.new("ERROR: Screens must extend UIViewController.") end [:action] ||= 'render' self. = self.params = [:params] || {} .each do |k, v| self.send("#{k}=", v) if self.respond_to?("#{k}=") end self end |
#title ⇒ Object
50 51 52 53 54 |
# File 'motion-prime/screens/_base_mixin.rb', line 50 def title title = self.class.title title = self.instance_eval(&title) if title.is_a?(Proc) title end |
#title=(new_title) ⇒ Object Also known as: set_title
56 57 58 59 |
# File 'motion-prime/screens/_base_mixin.rb', line 56 def title=(new_title) self.class.title(new_title) self..title = new_title end |