Module: IniFile
- Defined in:
- lib/ini-dsl/from_hash.rb
Class Method Summary collapse
Class Method Details
.from_hash(hash) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/ini-dsl/from_hash.rb', line 2 def self.from_hash hash hash.map do |section, properties| ["[#{section}]", *properties.map { |property, value| [property, ' = ', value].join }] .join "\n" end.join "\n" end |