Skip to content

Instantly share code, notes, and snippets.

@KacperPucek
Created May 6, 2016 10:47
Show Gist options
  • Save KacperPucek/20daa6d6afe909ba6607c0b0609f215c to your computer and use it in GitHub Desktop.
Save KacperPucek/20daa6d6afe909ba6607c0b0609f215c to your computer and use it in GitHub Desktop.
class A
attr_reader :stack
def initialize
@stack = Array.new
end
end
class B < A
attr_reader :name
def initialize(args={})
super
@name = args.fetch(:name, nil)
end
end
b = B.new({:name => 'Ruby'})
ArgumentError: wrong number of arguments (1 for 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment