Skip to content

Instantly share code, notes, and snippets.

@adamniedzielski
Created October 15, 2014 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamniedzielski/e92ca2f1cd3821ba67b9 to your computer and use it in GitHub Desktop.
Save adamniedzielski/e92ca2f1cd3821ba67b9 to your computer and use it in GitHub Desktop.
class CreateUserAccount
def self.build
self.new(SendWelcomeEmail.build, TrackRegistration.build)
end
def initialize(send_welcome_email, track_registration)
@send_welcome_email = send_welcome_email
@track_registration = track_registration
end
def perform(arg1, arg2)
...
end
end
class CreateUserAccount
class SendWelcomeEmail
def self.build
self.new
end
def perform(arg1, arg2)
...
end
end
end
class CreateUserAccount
class TrackRegistration
def self.build
self.new
end
def perform(arg1)
...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment