Sha256: 3fc151b93ad1630260b2881cf90720dba6a7ee77ff69f62090df346dbd839b88

Contents?: true

Size: 300 Bytes

Versions: 4

Compression:

Stored size: 300 Bytes

Contents

require 'yaml'
require 'ostruct'

module Mdoc
  ## parsed meta information from the source file
  class Meta < OpenStruct

    def load(contents)
      # contents is expected as a hash in yaml format
      YAML.load(contents).each { |k, v| self.send("#{k}=".to_sym, v) }
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mdoc-0.0.8 lib/mdoc/meta.rb
mdoc-0.0.7 lib/mdoc/meta.rb
mdoc-0.0.6 lib/mdoc/meta.rb
mdoc-0.0.5 lib/mdoc/meta.rb