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

Ruby warning fix: instance variable used before initialize #87

Merged
merged 1 commit into from Jul 15, 2020
Merged

Ruby warning fix: instance variable used before initialize #87

merged 1 commit into from Jul 15, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jul 15, 2020

Fixes #62

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling af896b0 on chaymaeBZ:ruby-warning-uninstialized-instance-variable into 5b1bb34 on savonrb:master.

@olleolleolle olleolleolle merged commit 0ee8958 into savonrb:master Jul 15, 2020
end

@sections = sections
@sections ||= begin
Copy link
Contributor

Choose a reason for hiding this comment

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

@chaymaeBZ @olleolleolle To simplify this code, we could use the Enumerable#group_by method... Wdyta?

@sections ||= document.root.element_children.group_by { |node| node.name }

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that sounds fine, if you make a PR, you can see if all tests still pass, would be nice.

Copy link
Contributor

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
Development

Successfully merging this pull request may close these issues.

Ruby warning - unused variable
3 participants