Class: Pocketbook::Book
- Inherits:
-
Object
- Object
- Pocketbook::Book
- Defined in:
- lib/pocketbook/book.rb
Instance Attribute Summary collapse
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
Instance Method Summary collapse
-
#initialize(inputs:, theme:, metadata: {}) ⇒ Book
constructor
A new instance of Book.
- #render_html ⇒ Object
- #render_to(output_path) ⇒ Object
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
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
3 4 5 |
# File 'lib/pocketbook/book.rb', line 3 def inputs @inputs end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/pocketbook/book.rb', line 3 def @metadata end |
#theme ⇒ Object (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_html ⇒ Object
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 |