Class: Runbook::Viewer
- Inherits:
-
Object
- Object
- Runbook::Viewer
- Defined in:
- lib/runbook/viewer.rb
Instance Attribute Summary collapse
-
#book ⇒ Object
readonly
Returns the value of attribute book.
Instance Method Summary collapse
- #additional_metadata ⇒ Object
- #generate(view: :markdown) ⇒ Object
-
#initialize(book) ⇒ Viewer
constructor
A new instance of Viewer.
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
#book ⇒ Object (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_metadata ⇒ Object
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 |