Class: Rohbau::Index::Validator
- Inherits:
-
Object
- Object
- Rohbau::Index::Validator
- Defined in:
- lib/rohbau/index.rb
Instance Method Summary collapse
-
#initialize(memory) ⇒ Validator
constructor
A new instance of Validator.
- #validate_add(entity) ⇒ Object
- #validate_add_with_uid(entity) ⇒ Object
- #validate_delete(uid) ⇒ Object
- #validate_get(uid) ⇒ Object
- #validate_update(entity) ⇒ Object
Constructor Details
#initialize(memory) ⇒ Validator
Returns a new instance of Validator.
126 127 128 |
# File 'lib/rohbau/index.rb', line 126 def initialize(memory) @memory = memory end |
Instance Method Details
#validate_add(entity) ⇒ Object
130 131 132 133 |
# File 'lib/rohbau/index.rb', line 130 def validate_add(entity) ensure_entity!(entity) ensure_entity_has_no_uid!(entity) end |
#validate_add_with_uid(entity) ⇒ Object
135 136 137 138 139 |
# File 'lib/rohbau/index.rb', line 135 def validate_add_with_uid(entity) ensure_entity!(entity) ensure_entity_has_uid!(entity) ensure_uid_type!(entity.uid) end |
#validate_delete(uid) ⇒ Object
152 153 154 |
# File 'lib/rohbau/index.rb', line 152 def validate_delete(uid) ensure_uid_exists!(uid) end |
#validate_get(uid) ⇒ Object
141 142 143 144 |
# File 'lib/rohbau/index.rb', line 141 def validate_get(uid) ensure_uid!(uid) ensure_uid_type!(uid) end |
#validate_update(entity) ⇒ Object
146 147 148 149 150 |
# File 'lib/rohbau/index.rb', line 146 def validate_update(entity) ensure_entity!(entity) ensure_entity_has_uid!(entity) ensure_entity_exists!(entity) end |