Module: Rxhp::AttributeValidator::ClassMethods
- Defined in:
- lib/rxhp/attribute_validator.rb
Instance Attribute Summary collapse
-
#acceptable_attributes ⇒ Object
Returns the value of attribute acceptable_attributes.
-
#required_attributes ⇒ Object
Returns the value of attribute required_attributes.
Instance Method Summary collapse
-
#accept_all_attributes ⇒ Object
Accept any attributes whatsoever.
-
#accept_attributes(pattern) ⇒ Object
(also: #accept_attribute)
Accept all attributes matching the specified pattern.
-
#require_attributes(pattern) ⇒ Object
(also: #require_attribute)
Require an attribute matching the specified pattern.
Instance Attribute Details
#acceptable_attributes ⇒ Object
Returns the value of attribute acceptable_attributes.
110 111 112 |
# File 'lib/rxhp/attribute_validator.rb', line 110 def acceptable_attributes @acceptable_attributes end |
#required_attributes ⇒ Object
Returns the value of attribute required_attributes.
110 111 112 |
# File 'lib/rxhp/attribute_validator.rb', line 110 def required_attributes @required_attributes end |
Instance Method Details
#accept_all_attributes ⇒ Object
Accept any attributes whatsoever.
142 143 144 |
# File 'lib/rxhp/attribute_validator.rb', line 142 def accept_all_attributes accept_attributes Object end |
#accept_attributes(pattern) ⇒ Object Also known as: accept_attribute
Accept all attributes matching the specified pattern.
127 128 129 |
# File 'lib/rxhp/attribute_validator.rb', line 127 def accept_attributes pattern acceptable_attributes.push pattern end |
#require_attributes(pattern) ⇒ Object Also known as: require_attribute
Require an attribute matching the specified pattern.
135 136 137 138 |
# File 'lib/rxhp/attribute_validator.rb', line 135 def require_attributes pattern accept_attributes pattern required_attributes.push pattern end |