Module: PR::Form::DSL
- Defined in:
- lib/pr/form.rb
Instance Method Summary collapse
- #field(name, type, options = {}) ⇒ Object
- #from_hash(hash, *args) ⇒ Object
- #from_model(model) ⇒ Object
Instance Method Details
#field(name, type, options = {}) ⇒ Object
10 11 12 |
# File 'lib/pr/form.rb', line 10 def field name, type, = {} PR::DefineAndRegister[ self, name, type, ] end |
#from_hash(hash, *args) ⇒ Object
13 14 15 16 17 |
# File 'lib/pr/form.rb', line 13 def from_hash hash, *args form = new *args PR::BuildFromHash[ form, hash ] form end |
#from_model(model) ⇒ Object
18 19 20 |
# File 'lib/pr/form.rb', line 18 def from_model model PR::BuildFromModel[ self, model ] end |