Class: Guider::GuideFactory

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

Overview

Creates Guide instances

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ GuideFactory

Returns a new instance of GuideFactory.



8
9
10
11
12
13
14
15
16
17
# File 'lib/guider/guide_factory.rb', line 8

def initialize(options)
  # Configure {@link} tags.
  @inline_tags = InlineTags.new
  @inline_tags.link_url = options[:link_url]

  # Create guide rendering template
  @tpl = DefaultTemplate.new(options[:tpl_dir] + "/guide.html", options)

  @options = options
end

Instance Method Details

#create(filename) ⇒ Object

Creates new Guide instance from filename



20
21
22
# File 'lib/guider/guide_factory.rb', line 20

def create(filename)
  Guide.new(filename, @tpl, @inline_tags, @options)
end