Class: Pocketbook::Book

Inherits:
Object
  • Object
show all
Defined in:
lib/pocketbook/book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inputs:, theme:, metadata: {}) ⇒ Book

Returns a new instance of Book.



5
6
7
8
9
# File 'lib/pocketbook/book.rb', line 5

def initialize(inputs:, theme:, metadata: {})
  @inputs = inputs
  @theme = theme
  @metadata = 
end

Instance Attribute Details

#inputsObject (readonly)

Returns the value of attribute inputs.



3
4
5
# File 'lib/pocketbook/book.rb', line 3

def inputs
  @inputs
end

#metadataObject (readonly)

Returns the value of attribute metadata.



3
4
5
# File 'lib/pocketbook/book.rb', line 3

def 
  @metadata
end

#themeObject (readonly)

Returns the value of attribute theme.



3
4
5
# File 'lib/pocketbook/book.rb', line 3

def theme
  @theme
end

Instance Method Details

#render_htmlObject



20
21
22
23
24
25
26
# File 'lib/pocketbook/book.rb', line 20

def render_html
  BookRenderer.new(
    inputs: @inputs,
    theme: @theme,
    metadata: @metadata
  ).render_html
end

#render_to(output_path) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pocketbook/book.rb', line 11

def render_to(output_path)
  BookRenderer.new(
    inputs: @inputs,
    theme: @theme,
    output_path: output_path,
    metadata: @metadata
  ).render
end