Class: Kitchen::BookRecipe
Overview
A specialized Recipe
that yields a BookDocument
instead of a plain Document
Instance Attribute Summary collapse
-
#book_short_name ⇒ Symbol
readonly
The book’s short name.
Attributes inherited from Recipe
#document, #my_i18n_backend, #source_location
Instance Method Summary collapse
-
#document=(document) ⇒ Object
Overrides
document=
to ensure aBookDocument
is stored. -
#initialize(book_short_name: :not_set) {|doc| ... } ⇒ BookRecipe
constructor
Make a new BookRecipe.
Methods inherited from Recipe
Constructor Details
#initialize(book_short_name: :not_set) {|doc| ... } ⇒ BookRecipe
Make a new BookRecipe
20 21 22 23 |
# File 'lib/kitchen/book_recipe.rb', line 20 def initialize(book_short_name: :not_set, &block) @book_short_name = book_short_name.to_sym super(&block) end |
Instance Attribute Details
#book_short_name ⇒ Symbol (readonly)
The book’s short name
13 14 15 |
# File 'lib/kitchen/book_recipe.rb', line 13 def book_short_name @book_short_name end |
Instance Method Details
#document=(document) ⇒ Object
Overrides document=
to ensure a BookDocument
is stored
29 30 31 32 33 34 35 36 |
# File 'lib/kitchen/book_recipe.rb', line 29 def document=(document) super(document) @document = Kitchen::BookDocument.new( document: @document, short_name: book_short_name, config: @document.config.clone ) end |