Skip to content

Removes redundant struct#13

Open
elcuervo wants to merge 1 commit into
cyx:masterfrom
elcuervo:removes_redundant_struct
Open

Removes redundant struct#13
elcuervo wants to merge 1 commit into
cyx:masterfrom
elcuervo:removes_redundant_struct

Conversation

@elcuervo

Copy link
Copy Markdown

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
Copy Markdown
Contributor

+1 :)

@frodsan

frodsan commented Apr 22, 2014

Copy link
Copy Markdown

👍

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