No commit activity in last 3 years
No release in over 3 years
ruboty-toggle_switch allows you to toggle switch on/off.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.0
~> 0.8

Runtime

~> 1.2
 Project Readme

Ruboty::ToggleSwitch

Build Status

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

Installation

Add this line to your application's Gemfile:

gem 'ruboty-toggle_switch'

Usage

ruboty: toggle <switch> (on|off) - Toggle key status.
ruboty: show <switch> status     - Show the current status.
ruboty: list switches            - List the statuses of switches

Examples

> 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.
> ruboty: list switches
- switch is off.

API

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

storage = Ruboty::ToggleSwitch::Storage.new(robot.brain)
record  = storage['switch']
record.status # => 'on' or 'off'

http://www.rubydoc.info/github/takai/ruboty-toggle_switch/master/Ruboty/ToggleSwitch/Storage