14. module UseCases::Samples
class UseCase
def initialize(initiator, project_id)
@initiator = initiator
@project_id = project_id
end
def run(input_data)
some_really_complex_stuff_here do |data|
b = bla(data)
c = blabla(project_id, data, b)
bla!(initiator, project_id, c)
end
end
private
attr_accessor :initiator, :project_id
def project
@project ||= Project.find_by_id(project_id)
end
end
end