Class YamlExtensions::ChopHeader
In: lib/yaml_extensions/chop_header.rb
Parent: Object

Methods

new  

Attributes

doc  [R] 

Public Class methods

[Source]

# File lib/yaml_extensions/chop_header.rb, line 10
    def initialize ( io )
      aStr = io.gets
      unless aStr =~ /^---/
        io.rewind
        raise Exception, "First line is not valid: `#{aStr}'"
      end
      io.each do |aLine|
        break if aLine =~ /^---/
        aStr += aLine
      end
      @doc = YAML::load(aStr)
    end

[Validate]