Module: Consular::DSL::Yaml
- Defined in:
- lib/consular/dsl.rb
Overview
Contains interpretation for the legacy YAML format.
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Returns yaml file as formmatted hash.
Instance Method Details
#to_hash ⇒ Hash
Returns yaml file as formmatted hash
202 203 204 205 206 207 208 209 210 |
# File 'lib/consular/dsl.rb', line 202 def to_hash @_file ||= {} combined = @_file.inject({}) do |base, item| item = {item.keys.first => {:commands => item.values.first, :options => {}}} base.merge!(item) base end # merge the array of hashes. { :setup => nil, :windows => { 'default' => { :tabs => combined } } } end |