# ServiceIt
[![Gem Version](https://badge.fury.io/rb/service_it.svg)](https://badge.fury.io/rb/service_it)
Its main objective is to provide you a way to delegate responsibilities in your project
## Installation
Add this line to your application's Gemfile:
gem 'service_it', '0.1.5'
And then execute:
$ bundle
Or install it yourself as:
$ gem install service_it
## Usage
Inherit your class of `Service` and implement `perform` method
```ruby
class Foo < Service
def perform
# here you can use params that became instance variables
end
end
```
Call your service from anywhere
```ruby
Foo.call(params)
```
## Example
Simple example to change status of a "transaction" to complete
```ruby
# app/services/complete_transation_service.rb
class CompleteTransation < Service
def perform
@transation.update(:status, :complete)
end
end
```
```ruby
if CompleteTransation.call(transation: @transation)
puts 'Transation complete!'
end
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/iago-silva/service_it.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).