Skip to content

Correct code to be Rubocop compliant#23

Open
RupertSaxton wants to merge 2 commits into
paircolumbus:masterfrom
RupertSaxton:rupert-rubocop
Open

Correct code to be Rubocop compliant#23
RupertSaxton wants to merge 2 commits into
paircolumbus:masterfrom
RupertSaxton:rupert-rubocop

Conversation

@RupertSaxton

Copy link
Copy Markdown

No description provided.

Comment thread gem_city.rb Outdated
@people = {
thieves: 5,
officers: 1
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these two values really need to be joined into Hash? Consider the simplification if they weren't.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I had used it because that's the way it came but having them as instance variables and using attr_accessor is much nicer

Comment thread gem_city.rb Outdated
@population = 50
end

def thieves(thieves_number = @people[:thieves])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Officers have both a getter and setter method, but thieves just have this hybrid method. I think two methods is better.

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