Git Product home page Git Product logo

oo-email-parser's Introduction

Object Oriented Email Parser

Learning Goals

  • Practice defining a class and using an attr_accessor to create setter and getter methods
  • Use TDD to write working code

Description

You will be writing an EmailAddressParser class that gets initialized with a string of emails.

Your job is to parse those email addresses into a useful array using an instance method, parse.

I should be able to do this:

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

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

You should be able to initialize with a list of email addresses either separated with spaces or separated with commas. The parse method should, additionally, 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:

  • How will you control for parsing a list of email addresses that is either comma separated or separated by a white space?
  • Use an attr_accessor to set and get the list of email addresses

oo-email-parser's People

Contributors

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oo-email-parser's Issues

IDE adding characters to my work causing test to fail and making debugging impossible

All kinds of issues wit the IDE, kept dropping out of reverting my work to previously saved version, up to 40 minutes old, then started adding characters and lines to my work. Had all kinds of frustrating hours before I finally realized what I was submitting was repeatedly being altered or reverted to previous changes.

This is what I am submitting:
require 'pry'

class EmailParser
attr_accessor :email_string

def initialize(email_string)
@email_string = email_string
end

def parse
@email_string = @email_string.split(/[\s,']/)
@email_string.reject! {|x| x.empty?}
@email_string.uniq
end

end

And this is what it is changing it to:

require 'pry'

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 :email_string
<<<<<<< HEAD

@@emails = []

c53f3e252a06ed52e84132d9a2513a629cb54aca

def initialize(email_string)
@email_string = email_string
end

def parse
<<<<<<< HEAD
@email_string = @email_string.split(/[\s,']/)
@email_string.delete_if {|c| c.empty?}
@email_string.uniq
end

end

=======
@email_string = @email_string.split(/[\s,]/)
@email_string.reject! {|x| x.empty?}
@email_string.uniq
end
end

c53f3e252a06ed52e84132d9a2513a629cb54aca

lesson heading on tab

when I choose a new lesson under the Curriculum drop down tab, I can switch to the new lab without a problem. However the name of the lesson that's displayed in the browser tab remains set to the old lesson's name. this is in chrome, and is a general issue, not just the email parser lab

The solution on github is outdated

The solution only accounts for splitting on "," and not the current instructions to work for addresses separated by only white spaces as well as ones separated by commas

parser? or parse

Encountered this while trying to pass lab:

Is it #parser or #parse that we are supposed to write? The errors I got related to 'parse`

The test asks for EmailAddressParses

Hi there,

The test for this lab asks for EmailAddressParses, but the notes say to call it EmailParser not a bit issue, but through i would raise it

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.