Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 737 Bytes

SERVICE.md

File metadata and controls

25 lines (21 loc) · 737 Bytes

Service Generator Documentation

This boilerplate is using dry-monads gem for service structure. If you need service, you can use custom service generator like that:

$ rails generate service Facebook::Adset 

Then, it will create some service classes for your operations.

create  app/services/facebook/adset_service.rb
create  test/services/facebook/adset_service_test.rb

You can access service templates from /lib/generators/service folder.

Sample list service usage

class UsersController < ApplicationController
  def index
    service = UserService::List.new(query: query_object,
                                    pagination: pagination_object).call

    @users = service.success
  end
end