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

Completed First Ruby Asg - Ming #7

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

Conversation

rollba14
Copy link

21/22

Didnt attempt the "remove special characters in strings (BONUS)" for format_name. Everything else i got it down. Probably just need some googling of doing regex

Copy link

@spragala spragala left a comment

Choose a reason for hiding this comment

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

Great Job Ming!

def generate_username (first, last, year, p_level = 0)

# put in variable for easy reference
new_username = format_name(first,last) + year.to_s[-2, year.to_s.length-1]

Choose a reason for hiding this comment

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

You have a method to format the year!

new_username = format_name(first,last) + format_year(year)

end

def user_type_prefix (num)
if num == 0

Choose a reason for hiding this comment

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

I'm getting some code smell - you've already written this code before. How can you refactor this code by calling the check_privilege method?

# registered user name, if match, add '_count' to new_username, update count
# and then push into increment_name list associated with that matched user
# and then return that incremented name as output
if $users[0] == nil

Choose a reason for hiding this comment

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

Great solution!

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.

2 participants