Sha256: 05c4e6e61b1f725a63546738ae9172a19a06e78d52ceb74901ad4624eb8ebca9

Contents?: true

Size: 567 Bytes

Versions: 16

Compression:

Stored size: 567 Bytes

Contents

module Nucleon
module Translator
class YAML < Nucleon.plugin_class(:nucleon, :translator)
   
  #-----------------------------------------------------------------------------
  # Translator operations
   
  def parse(yaml_text)
    return super do |properties|
      if yaml_text && ! yaml_text.empty?
        properties = Util::Data.symbol_map(Util::Data.parse_yaml(yaml_text))
      end
      properties
    end
  end
  
  #---
  
  def generate(properties)
    return super do
      Util::Data.to_yaml(Util::Data.string_map(properties))
    end
  end
end
end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
nucleon-0.2.16 lib/nucleon/translator/YAML.rb
nucleon-0.2.15 lib/nucleon/translator/YAML.rb
nucleon-0.2.14 lib/nucleon/translator/YAML.rb
nucleon-0.2.13 lib/nucleon/translator/YAML.rb
nucleon-0.2.12 lib/nucleon/translator/YAML.rb
nucleon-0.2.11 lib/nucleon/translator/YAML.rb
nucleon-0.2.10 lib/nucleon/translator/YAML.rb
nucleon-0.2.9 lib/nucleon/translator/YAML.rb
nucleon-0.2.8 lib/nucleon/translator/YAML.rb
nucleon-0.2.7 lib/nucleon/translator/YAML.rb
nucleon-0.2.6 lib/nucleon/translator/YAML.rb
nucleon-0.2.5 lib/nucleon/translator/YAML.rb
nucleon-0.2.4 lib/nucleon/translator/YAML.rb
nucleon-0.2.3 lib/nucleon/translator/YAML.rb
nucleon-0.2.2 lib/nucleon/translator/YAML.rb
nucleon-0.2.1 lib/nucleon/translator/YAML.rb