Class: ProMotion::FormScreen
Instance Attribute Summary collapse
Instance Method Summary
collapse
#style, #style!, #style?
#didRotateFromInterfaceOrientation, #loadView, new, #shouldAutorotate, #shouldAutorotateToInterfaceOrientation, #viewDidAppear, #viewDidDisappear, #viewWillAppear, #viewWillDisappear, #willRotateToInterfaceOrientation
Instance Attribute Details
Returns the value of attribute form_object.
6
7
8
|
# File 'lib/ProMotion/form/form_screen.rb', line 6
def form_object
@form_object
end
|
Instance Method Details
#dismiss_keyboard ⇒ Object
25
26
27
|
# File 'lib/ProMotion/form/form_screen.rb', line 25
def dismiss_keyboard
self.view.endEditing true
end
|
13
14
15
16
|
# File 'lib/ProMotion/form/form_screen.rb', line 13
def form_data
PM.logger.info "You need to implement a `form_data` method in #{self.class.to_s}."
[]
end
|
29
30
31
|
# File 'lib/ProMotion/form/form_screen.rb', line 29
def render_form
Hash[form_object.each_pair.to_a].tap{|h| h.delete(:fields) }
end
|
18
19
20
21
22
23
|
# File 'lib/ProMotion/form/form_screen.rb', line 18
def update_form_data
@form_object = PM::Form.new(self.form_data).build
self.formController.form = @form_object
self.formController.delegate = self
self.view.reloadData
end
|
#viewDidLoad ⇒ Object
8
9
10
11
|
# File 'lib/ProMotion/form/form_screen.rb', line 8
def viewDidLoad
super
update_form_data
end
|