-
-
Save duykhoa/80513f54d69bdfe85b5c1be11b3e2655 to your computer and use it in GitHub Desktop.
test
This file contains 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
class ImportParticipant | |
def initialize(source:, :target) | |
@source = source | |
@target = target | |
end | |
attr_reader :source, :target | |
def call | |
data = @source.read_and_parse | |
@target.bulk_create(data) | |
end | |
end | |
# Implement a Source class | |
class XlsSource | |
def initialize(file_reader) | |
@file_reader = file_reader | |
end | |
attr_reader :file_reader | |
def read_and_parse | |
data = file_reader.read | |
parse(data) | |
end | |
def parse(data) | |
end | |
end | |
class XlsReader | |
def initialize(file) | |
@file = file | |
end | |
def read | |
# call Roo | |
end | |
end | |
class CreateParticipant | |
def bulk_create(data) | |
end | |
end |
Author
duykhoa
commented
Jan 18, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment