Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more
# File rss/utils.rb, line 98 def inherited_array_reader(constant_name) inherited_reader(constant_name) do |result, current| current + result end end
# File rss/utils.rb, line 104 def inherited_hash_reader(constant_name) inherited_reader(constant_name) do |result, current| result.merge(current) end end
# File rss/utils.rb, line 82 def inherited_reader(constant_name) base_class = inherited_base result = base_class.const_get(constant_name) found_base_class = false ancestors.reverse_each do |klass| if found_base_class if klass.const_defined?(constant_name) result = yield(result, klass.const_get(constant_name)) end else found_base_class = klass == base_class end end result end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.