ruby / xmlrpc

The Ruby standard library package 'xmlrpc'
Other
37 stars 26 forks source link

Create accessor methods to XMLRPC::Config #40

Closed herwinw closed 1 year ago

herwinw commented 1 year ago

Currently the config is made up of a number of constants, changing the config does require some boilerplate to redefine constants. An example:

XMLRPC::Config.module_eval { remove_const(:ENABLE_NIL_PARSER) }
XMLRPC::Config::ENABLE_NIL_PARSER = true

This change adds accessor methods to the Config module, so you can simply write them like this:

XMLRPC::Config.enable_nil_parser = true

It still uses the constants under water, which means it is fully backwards compatible (which was the big objection in #39 )

kou commented 1 year ago

Thanks. I've merged this.