def_children_accessor(accessor_name, plural_name) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rss/rss.rb, line 377
    def def_children_accessor(accessor_name, plural_name)
      module_eval("def \#{plural_name}\n@\#{accessor_name}\nend\n\ndef \#{accessor_name}(*args)\nif args.empty?\n@\#{accessor_name}.first\nelse\n@\#{accessor_name}[*args]\nend\nend\n\ndef \#{accessor_name}=(*args)\nwarn(\"Warning:\\\#{caller.first.sub(/:in `.*'\\z/, '')}: \" \\\n\"Don't use `\#{accessor_name} = XXX'/`set_\#{accessor_name}(XXX)'. \" \\\n\"Those APIs are not sense of Ruby. \" \\\n\"Use `\#{plural_name} << XXX' instead of them.\")\nif args.size == 1\n@\#{accessor_name}.push(args[0])\nelse\n@\#{accessor_name}.__send__(\"[]=\", *args)\nend\nend\nalias_method(:set_\#{accessor_name}, :\#{accessor_name}=)\n", *get_file_and_line_from_caller(2))
    end
Register or log in to add new notes.