Class: Codex::Pressie

Inherits:
Object
  • Object
show all
Defined in:
lib/codex/pressie.rb

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ Pressie

Returns a new instance of Pressie.



7
8
9
10
11
# File 'lib/codex/pressie.rb', line 7

def initialize()
  YAML.load_file().each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Method Details

#process(input, output) ⇒ Object



13
14
15
16
17
18
# File 'lib/codex/pressie.rb', line 13

def process(input, output)
  content = Content.new(input).to_html
  File.open(output, 'w') do |f|
    f << ERB.new(File.read(File.join(Codex.root, 'templates', 'layout.erb'))).result(binding)
  end
end