Class: Datum::FormValidator::Form
- Inherits:
-
Object
- Object
- Datum::FormValidator::Form
- Defined in:
- lib/datum/form_validator/entities/form.rb
Instance Attribute Summary collapse
-
#attribute_source ⇒ Object
writeonly
Sets the attribute attribute_source.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #add_attribute(attribute) ⇒ Object
-
#initialize ⇒ Form
constructor
A new instance of Form.
- #new_attribute(*args) ⇒ Object
Constructor Details
#initialize ⇒ Form
Returns a new instance of Form.
9 10 11 |
# File 'lib/datum/form_validator/entities/form.rb', line 9 def initialize @attributes = [] end |
Instance Attribute Details
#attribute_source=(value) ⇒ Object
Sets the attribute attribute_source
7 8 9 |
# File 'lib/datum/form_validator/entities/form.rb', line 7 def attribute_source=(value) @attribute_source = value end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/datum/form_validator/entities/form.rb', line 6 def attributes @attributes end |
Instance Method Details
#add_attribute(attribute) ⇒ Object
19 20 21 |
# File 'lib/datum/form_validator/entities/form.rb', line 19 def add_attribute(attribute) attributes << attribute end |
#new_attribute(*args) ⇒ Object
13 14 15 16 17 |
# File 'lib/datum/form_validator/entities/form.rb', line 13 def new_attribute(*args) attribute_source.call(*args).tap do |attribute| attribute.form = self end end |