Skip to content

Instantly share code, notes, and snippets.

@Kevin-Kawai
Last active November 26, 2017 03:38
Show Gist options
  • Save Kevin-Kawai/2cf52e4aa1621e786e4866decc329eeb to your computer and use it in GitHub Desktop.
Save Kevin-Kawai/2cf52e4aa1621e786e4866decc329eeb to your computer and use it in GitHub Desktop.
reading code?
class ApprovalService
def initialize(input_form)
@input_form = input_form
end
def approve
DataStuff.new(input_form)
DataStuff.save!
end
end
class PagesController < ApplicationController
def index
@input_form = InputForm.new
end
def approve
@input_form = InputForm.new
ApprovalService.new(@input_form).approve!
end
end
class InputForm
after_initialize do
self.current_date = Date.current
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment