Allow configs with indifferent access
Closed this issue · 1 comments
pilaf commented
Currently FmRest's configs require symbol keys. Since these configs are often loaded from YAML files though it would be good if we could support indifferent access (e.g. strings OR symbols for keys).
E.g., currently this fails:
# fmrest_config.yml
host: foo.com
database: Database
FmRest.config = YAML.load_file("fmrest_config.yml")
When trying to connect with the above example the gem will complain that it can't find :host
in the config hash, etc.
Note that YAML does support symbol keys (just prefix :
to each key), but that's kinda ugly and not great to require it.
BTW, we don't want to use Rails' HashWithIndifferentAccess
.
pilaf commented
Addressed with inclusion of FmRest::ConnectionSettings
.