Class: Mdoc::Meta

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/mdoc/meta.rb

Overview

parsed meta information from the source file

Instance Method Summary collapse

Constructor Details

#initializeMeta

Returns a new instance of Meta.



7
8
9
10
11
12
# File 'lib/mdoc/meta.rb', line 7

def initialize
  super()
  [:header_js_libs, :footer_js_libs, :footer_js_srcs].each do |k|
    send("#{k}=".to_sym, [])
  end
end

Instance Method Details

#load(contents) ⇒ Object



14
15
16
17
18
# File 'lib/mdoc/meta.rb', line 14

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