Class: Guider::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/guider/index.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Index

Returns a new instance of Index.



6
7
8
9
10
# File 'lib/guider/index.rb', line 6

def initialize(options)
  @options = options
  @config = Config.new(@options[:index])
  @tpl = DefaultTemplate.new(@options[:tpl_dir] + "/index.html", @options)
end

Instance Method Details

#writeObject



12
13
14
15
16
17
# File 'lib/guider/index.rb', line 12

def write
  html = @tpl.apply({
    :content => @config.to_html,
  })
  File.open(@options[:output] + "/index.html", 'w') {|f| f.write(html) }
end