Class: Runbook::Viewer

Inherits:
Object
  • Object
show all
Defined in:
lib/runbook/viewer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(book) ⇒ Viewer

Returns a new instance of Viewer.



5
6
7
# File 'lib/runbook/viewer.rb', line 5

def initialize(book)
  @book = book
end

Instance Attribute Details

#bookObject (readonly)

Returns the value of attribute book.



3
4
5
# File 'lib/runbook/viewer.rb', line 3

def book
  @book
end

Instance Method Details

#additional_metadataObject



20
21
22
# File 'lib/runbook/viewer.rb', line 20

def 
  {}
end

#generate(view: :markdown) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/runbook/viewer.rb', line 9

def generate(view: :markdown)
  view = "Runbook::Views::#{view.to_s.camelize}".constantize
   = Util::StickyHash.new.
  merge(Runbook::Entities::Book.).
  merge()

  StringIO.new.tap do |output|
    book.render(view, output, )
  end.string
end