Array() will do the job:
Array(nil) => []
Array([1,2,3]) => [1, 2, 3]
Array(1) => [1]
In your case:
Array(conf[‘hosts’][hostname][‘groups’]).each { … }
Gennady.
Array() will do the job:
Array(nil) => []
Array([1,2,3]) => [1, 2, 3]
Array(1) => [1]
In your case:
Array(conf[‘hosts’][hostname][‘groups’]).each { … }
Gennady.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs