Class: Bound::BoundValidator
- Inherits:
-
Object
- Object
- Bound::BoundValidator
- Defined in:
- lib/bound.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#nested_array_attributes ⇒ Object
Returns the value of attribute nested_array_attributes.
-
#optional_attributes ⇒ Object
Returns the value of attribute optional_attributes.
Instance Method Summary collapse
-
#initialize(target, overwrite) ⇒ BoundValidator
constructor
A new instance of BoundValidator.
- #validate! ⇒ Object
Constructor Details
#initialize(target, overwrite) ⇒ BoundValidator
Returns a new instance of BoundValidator.
36 37 38 39 |
# File 'lib/bound.rb', line 36 def initialize(target, overwrite) @target = target @overwrite = overwrite end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
34 35 36 |
# File 'lib/bound.rb', line 34 def attributes @attributes end |
#nested_array_attributes ⇒ Object
Returns the value of attribute nested_array_attributes.
34 35 36 |
# File 'lib/bound.rb', line 34 def nested_array_attributes @nested_array_attributes end |
#optional_attributes ⇒ Object
Returns the value of attribute optional_attributes.
34 35 36 |
# File 'lib/bound.rb', line 34 def optional_attributes @optional_attributes end |
Instance Method Details
#validate! ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/bound.rb', line 41 def validate! ensure_all_attributes_are_known! attributes.each do |attribute| ensure_present! attribute end nested_array_attributes.each do |nested_array_attribute| ensure_array! nested_array_attribute end end |