-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock light state using the Light class interface #162
Comments
Maybe instead of emphasizing setting state, we can emphasize locking the circuit breaker: light = Stoplight('example-locked') { true }
light.lock(Stoplight::Color::RED) Users don't have to know about the |
@bolshakov yes, that's a great idea! I also think that to unlock it, we can just use the |
This makes sense to me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To manually lock the state of light, we use the
data_store
interface. For example:However, it allows us to use the interface of one light to lock the state of any other light. To avoid this situation, I'd like to add the
Light#set_state
method, which will be called like this:This implementation will clearly show for what light we lock the state.
The text was updated successfully, but these errors were encountered: