Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

lita-service

Build Status Coverage Status

Plugin to create a service with value or custom value per client and to manage how many times a customer use or consume this service.

Installation

Add lita-service to your Lita instance's Gemfile:

gem "lita-service"

Usage

 lita service list
 lita service create        <NAME> <*VALUE>                 # Value will be set to 0 if empty.
 lita service show          <NAME>
 lita service delete|remove <NAME>

 lita service <NAME> inscribe      <CUSTOMER> <*VALUE>      # Value will be set to service's value if empty.
 lita service <NAME> delete|remove <CUSTOMER>
 lita service <NAME> add|sum       <CUSTOMER> <*QUANTITY>   # Quantity will be set to 1 if empty.
 lita service <NAME> add|sum all   <*QUANTITY>              # Quantity will be set to 1 if empty.
 lita service <NAME> value         <CUSTOMER> <VALUE>
 lita service <NAME> reset         <CUSTOMER>

To show the available commands

 lito help service

Example

 lita service list
 lita service create awesome-service 200
 lita service show awesome-service
 lita service delete awesome-service
 lita service remove awesome-service

 lita service awesome-service inscribe erlinis
 lita service awesome-service add erlinis 2
 lita service awesome-service sum erlinis 2
 lita service awesome-service add all 3
 lita service awesome-service sum all 3
 lita service awesome-service delete erlinis
 lita service awesome-service remove erlinis
 lita service awesome-service value erlinis 300
 lita service awesome-service reset erlinis

Test

To run the tests use

 rake spec