class Kitchen::BookRecipe

A specialized Recipe that yields a BookDocument instead of a plain Document

Attributes

book_short_name[R]

The book's short name

@return [Symbol]

Public Class Methods

new(book_short_name: :not_set, &block) click to toggle source

Make a new BookRecipe

@param book_short_name [Symbol, String] the book's short name @yieldparam doc [BookDocument] an object representing an XML document

Calls superclass method
# 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

Public Instance Methods

document=(document) click to toggle source

Overrides document= to ensure a BookDocument is stored

@param document [Document, Nokogiri::XML::Document] the document

Calls superclass method
# 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