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

Removes redundant struct #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elcuervo
Copy link

This is a totally stupid PR but I'll send it because I was going to add going to add a feature to CLI.add to allow multiple additions but then I regret it :P

Using class Something < Struct.new(:a) generates a useless instance of which the class inherits. It can be called Something = Struct.new(:a)

class A < Struct.new(:a)
end

B = Struct.new(:b)

A.ancestors
# => [A, #<Class:0x007fbee3027908>, Struct, Enumerable, Object, Kernel, BasicObject]

B.ancestors
# => [B, Struct, Enumerable, Object, Kernel, BasicObject]

Again, this is probably stupid but I enjoy reading your code.

@djanowski
Copy link
Contributor

+1 :)

@frodsan
Copy link

frodsan commented Apr 22, 2014

👍

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