dep icon indicating copy to clipboard operation
dep copied to clipboard

Removes redundant struct

Open elcuervo opened this issue 11 years ago • 2 comments

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.

elcuervo avatar Jan 20 '14 23:01 elcuervo

+1 :)

djanowski avatar Mar 31 '14 13:03 djanowski

:+1:

frodsan avatar Apr 22 '14 17:04 frodsan