Class: FormObjectModel::FieldModule
- Inherits:
-
Module
- Object
- Module
- FormObjectModel::FieldModule
- Defined in:
- lib/form_object_model/field_module.rb
Overview
A module that defines the getter and setter for the field properties of a form.
Instance Method Summary collapse
-
#initialize(name, field) ⇒ FieldModule
constructor
A new instance of FieldModule.
Constructor Details
#initialize(name, field) ⇒ FieldModule
Returns a new instance of FieldModule.
5 6 7 8 |
# File 'lib/form_object_model/field_module.rb', line 5 def initialize(name, field) define_method(name.to_sym) { |*args| field } define_method("#{name}=".to_sym) { |val| field.fill(val) } end |