Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 396 Bytes

super-magic-keyword2.md

File metadata and controls

25 lines (18 loc) · 396 Bytes

Super magic keyword2

class Parent
  def show_args(*args, &block)
    p [*args, block]
  end
end

class Child < Parent
  def show_args(a,b,c)
    super
  end
end

#Everything goes up, including the block
Child.new.show_args(:a, :b, :c) { :block }

# Result:
# [:a, :b, :c, #<Proc:0x007fbf7a0486e8@super_magic_keyword2.rb:14>]

View Source