What is the correct syntax to specify required config attributes like ldap.base_dn, ldap.host or database.host? I cannot seem to get it right.
I have tried:
required :ldap[:base_dn]
Error:
config.rb:31:in `[]': no implicit conversion of Symbol into Integer (TypeError)
Then:
required :ldap['base_dn']
Which doesn't anger Ruby but seems to resolve to nil:
The following config parameters for `LdapSync::Config(config_name: times_sync_ldap_group)` are missing or empty:
And lastly:
required ldap['base_dn']
Which Ruby doesn't like:
config.rb:31:in `<class:Config>': undefined local variable or method `ldap' for LdapSync::Config:Class (NameError)
I am out of ideas and would be thankful for some insight. Is this even possible?
I haven't used anyway config before but I really appreciate all the work it takes off my hands, since before I've been handling YAML-based config settings (loading, reading, validating, etc.) pretty much manually and not in an efficient way like anyway config does. Thanks for creating it!
Ruby Version: 2.7.6
Framework Version (Rails, whatever): none, pure Ruby
What did you do?
Given a config class like this:
What is the correct syntax to specify required config attributes like
ldap.base_dn
,ldap.host
ordatabase.host
? I cannot seem to get it right.I have tried:
Error:
Then:
Which doesn't anger Ruby but seems to resolve to nil:
And lastly:
Which Ruby doesn't like:
I am out of ideas and would be thankful for some insight. Is this even possible?
I haven't used anyway config before but I really appreciate all the work it takes off my hands, since before I've been handling YAML-based config settings (loading, reading, validating, etc.) pretty much manually and not in an efficient way like anyway config does. Thanks for creating it!
Ruby Version: 2.7.6
Framework Version (Rails, whatever): none, pure Ruby
Anyway Config Version: 2.3.1