rspec/rules/S2357/description.adoc
2020-06-30 17:16:12 +02:00

2 lines
413 B
Plaintext

Fields should not be part of an API, and therefore should always be private. Indeed, they cannot be added to an interface for instance, and validation cannot be added later on without breaking backward compatibility. Instead, developers should encapsulate their fields into properties. Explicit property getters and setters can be introduced for validation purposes or to smooth the transition to a newer system.