Skip to content

porras/nested_open_struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages