Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 732 Bytes

README.md

File metadata and controls

25 lines (21 loc) · 732 Bytes

NestedOpenStruct Build Status

Thin wrapper around OpenStruct in order to create nested structs. Useful for storing configuration settings e.g. loaded from a YAML file.

Example:

data = NestedOpenStruct.new(
  :services => {
    :ftp => {
      :host => 'ftp.example.com',
      :login => 'wadus',
      :password => 'secret'
    },
    :web => {
      :url => 'http://example.com/'
    }
  }
)

data.services.ftp.host
 => "ftp.example.com" 
data.services.ftp.login
 => "wadus" 
data.services.web.url
 => "http://example.com/"