Build Status

ruboty-toggle_switch allows you to toggle switch on/off.


Add this line to your application's Gemfile:

gem 'ruboty-toggle_switch'


> ruboty: toggle switch on
switch is now on.
> ruboty: show switch status
switch is on on Apr 27 at 06:29.
> ruboty: toggle switch off for good sleeping
switch is now off.
> ruboty: show switch status
switch is off for good sleeping on Apr 27 at 06:30.


Use Ruboty::ToggleSwitch::Storage to get the state of switch from another handlers:

storage =
record  = storage['switch']
record.status # => 'on' or 'off'