Skip to content

Commit

Permalink
Done.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimejohnsen committed Aug 10, 2018
1 parent ea555f0 commit 780d991
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/email_parser.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Build a class EmailParser that accepts a string of unformatted
# Build a class EmailParser that accepts a string of unformatted
# emails. The parse method on the class should separate them into
# unique email addresses. The delimiters to support are commas (',')
# or whitespace (' ').

class EmailParser
attr_accessor :emails

def initialize(email) #using initialize, want the new object to have initial data before we add behavior
@emails = email#sets local variable email to an instance variable
end

def parse
emails.delete(",").split.uniq
end

end

0 comments on commit 780d991

Please sign in to comment.