Module: Kitchen::Directions::BakeChapterIntroductions

Defined in:
lib/kitchen/directions/bake_chapter_introductions/v1.rb,
lib/kitchen/directions/bake_chapter_introductions/v2.rb,
lib/kitchen/directions/bake_chapter_introductions/main.rb,
lib/kitchen/directions/bake_chapter_introductions/bake_chapter_outline.rb,
lib/kitchen/directions/bake_chapter_introductions/bake_chapter_objectives.rb

Defined Under Namespace

Classes: BakeChapterObjectives, BakeChapterOutline, V1, V2

Class Method Summary collapse

Class Method Details

.bake_chapter_objectives(chapter:, strategy:) ⇒ Object



33
34
35
36
37
38
# File 'lib/kitchen/directions/bake_chapter_introductions/main.rb', line 33

def self.bake_chapter_objectives(chapter:, strategy:)
  BakeChapterObjectives.new.bake(
    chapter: chapter,
    strategy: strategy
  )
end

.bake_chapter_outline(chapter_objectives_html:) ⇒ Object



40
41
42
43
44
# File 'lib/kitchen/directions/bake_chapter_introductions/main.rb', line 40

def self.bake_chapter_outline(chapter_objectives_html:)
  BakeChapterOutline.new.bake(
    chapter_objectives_html: chapter_objectives_html
  )
end

.v1(book:) ⇒ Object



6
7
8
9
10
# File 'lib/kitchen/directions/bake_chapter_introductions/main.rb', line 6

def self.v1(book:)
  V1.new.bake(
    book: book
  )
end

.v1_update_selectors(something_with_selectors) ⇒ Object



46
47
48
49
# File 'lib/kitchen/directions/bake_chapter_introductions/main.rb', line 46

def self.v1_update_selectors(something_with_selectors)
  something_with_selectors.selectors.title_in_introduction_page =
    ".intro-text > [data-type='document-title']"
end

.v2(book:, options: { strategy: :default, bake_chapter_outline: false, introduction_order: :v1, block_target_label: false, cases: false }) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/kitchen/directions/bake_chapter_introductions/main.rb', line 12

def self.v2(
  book:,
  options: {
    strategy: :default, bake_chapter_outline: false, introduction_order: :v1,
    block_target_label: false,
    cases: false
  }
)
  options.reverse_merge!(
    strategy: :default,
    bake_chapter_outline: false,
    introduction_order: :v1,
    block_target_label: false,
    cases: false
  )
  V2.new.bake(
    book: book,
    options: options
  )
end