Closed bigxiang closed 8 years ago
Good catch! I think the README is incorrect here. I'll remove mention of super
. AFAIK you can't call super from a block like that. Sorry!
@jferris, any thoughts?
@henrik I thought I had tried this out with super
when I submitted the pull request. I'll have to take a look at this on Friday.
@jferris Sounds good, thank you! Maybe some later change broke it.
Thank you for looking into this. At first, I wanted to figure it out by myself, but due to my limitation of the knowledge, I couldn't get it :)
@bigxiang Great that you tried, though :) @jferris No worries if you haven't had the time, but any news?
@henrik I haven't gotten to take a look at this yet. I still plan to, though!
Since the docs no longer mention super
, I'll close this issue and will consider it an unsupported feature. If someone wants to look into it and add support (if possible), please open a PR!
In the document, it says:
attr_initialize
can also accept a block which will be invoked after initialization. This is useful for callingsuper
appropriately in subclasses or initializing private data as necessary.But there isn't an example for this case, when I want to call
super
inattr_initialize
, I don't know how to make it working.Do I use it incorrectly? I am using Ruby 2.0.0p353