Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Super Fizz Buzz and Deaf Grandma drills and rspec tests. #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ericnoble
Copy link

Please review @jaybobo .

Copy link
Member

@jaybobo jaybobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Check out some of these comments.

@@ -1,13 +1,29 @@
class SuperFizzBuzz

def run(input)
output = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not seeing it. How would I use .tap here to avoid initializing output to an empty string?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use it to simplify your code a bit here because it returns itself. You'll see .tap used quite a bit. Let's say...

def run_service
  api_service.tap do |s|
    s.prepare_data
    s.send_emails
    s.log_something
  end
end

In this particular case, you could...

"".tap do |fizz_buzz_string|
  fizz_buzz_string << "Fizz" if condition
  ...
end

lib/fizzbuzz.rb Outdated

end
if divBy3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/fizzbuzz.rb Outdated

if divBy3 || divBy5
return output
Copy link
Member

@jaybobo jaybobo Mar 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/fizzbuzz.rb Outdated
if divBy3 || divBy5
return output
else
return input
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or here?

if input == input.upcase
#YELL
if input == "BYE"
@bye_counter = @bye_counter + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants