Sha256: 52f436d850f998b41743b9d3bc6cec223d2bb70890432cab33de48093d0a57a8

Contents?: true

Size: 449 Bytes

Versions: 2

Compression:

Stored size: 449 Bytes

Contents

require 'yaml'
require 'ostruct'

module Mdoc
  ## parsed meta information from the source file
  class Meta < OpenStruct
    def initialize
      super()
      [:header_js_libs, :footer_js_libs, :footer_js_srcs].each do |k|
        send("#{k}=".to_sym, [])
      end
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mdoc-0.0.11 lib/mdoc/meta.rb
mdoc-0.0.10 lib/mdoc/meta.rb