Created
April 14, 2014 17:33
-
-
Save laser/10667903 to your computer and use it in GitHub Desktop.
06: First Rails client initializer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/services.rb | |
require 'barrister-rails' | |
class Services | |
def self.user_service | |
@@services ||= proxy_services | |
@@services[:user_service] | |
end | |
def self.proxy_services | |
service = UserService.new(MailService.new) | |
idl = './services/user_service/interface.json' | |
client = Barrister::Rails::Client.new service, idl | |
{ user_service: client.UserService } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment