Skip to content

Instantly share code, notes, and snippets.

View davydotcom's full-sized avatar

David Estes davydotcom

View GitHub Profile
@davydotcom
davydotcom / Service Layer Example.rb
Last active December 10, 2015 15:08
Example of creating a service class in Rails that uses exception raising
class Gl::TransactionsController < ApplicationController
def new
end
def create
teller = Gl::TellerService.new()
response = teller.transfer_funds(params)
if response.successful?
@transactions = response.data
respond_with @transactions