GithubHelp home page GithubHelp logo

samuelbanya / phase-3-ruby-oo-basics-email-parser-lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-curriculum/phase-3-ruby-oo-basics-email-parser-lab

0.0 0.0 0.0 25 KB

License: Other

Ruby 100.00%

phase-3-ruby-oo-basics-email-parser-lab's Introduction

Bonus: Email Parser Lab

Learning Goals

  • Build a class that uses an initialize method
  • Practice using an attribute accessor macro to make an attribute available to a class's methods
  • Learn about Ruby's String.split method
  • Learn about RegEx

Description

You will write a program that, given a string of email addresses, parses that string into an array.

Your class, EmailAddressParser, should take the string of addresses on initialization. Instances should respond to a #parse instance method that parses the string into individual email addresses and returns them in an array.

Your class should be able to do this:

email_addresses = "[email protected], [email protected]"
parser = EmailAddressParser.new(email_addresses)

parser.parse
# => ["[email protected]", "[email protected]"]

Note: Your EmailAddressParser class should handle a list of email addresses that are separated by either spaces or comma-separated values (CSVs):

EmailAddressParser.new("[email protected], [email protected]").parse
# => ["[email protected]", "[email protected]"]

EmailAddressParser.new("[email protected] [email protected]").parse
# => ["[email protected]", "[email protected]"]

Additionally, the #parse method should only return unique addresses.

Instructions

This lab is test-driven, so run the test suite to get started and use the test output to get the program working.

Hints: in order to get this lab passing, you will need to do some research into the following topics:

  • Ruby's String.split method
  • RegEx - you'll use this to specify which characters to split the string on
  • Look at the Ruby documentation for the Array class. What method could be used to return an array of unique values?

Resources

phase-3-ruby-oo-basics-email-parser-lab's People

Contributors

kthffmn avatar sarogers avatar lizbur10 avatar maxwellbenton avatar loganhasson avatar fislabstest avatar ihollander avatar ahimmelstoss avatar sophiedebenedetto avatar victhevenot avatar samuelbanya avatar nancyko avatar campbelllsssoup avatar deniznida avatar bhollan avatar fs-lms-test-bot avatar benjagross avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.