Class: Kitchen::Directions::BakeFolio::V1::FolioPara

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/directions/bake_folio.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass:, title:) ⇒ FolioPara

Returns a new instance of FolioPara.



43
44
45
46
# File 'lib/kitchen/directions/bake_folio.rb', line 43

def initialize(klass:, title:)
  @klass = klass
  @title = title
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



40
41
42
# File 'lib/kitchen/directions/bake_folio.rb', line 40

def klass
  @klass
end

#titleObject (readonly)

Returns the value of attribute title.



41
42
43
# File 'lib/kitchen/directions/bake_folio.rb', line 41

def title
  @title
end

Instance Method Details

#create_paraObject



48
49
50
51
52
53
54
55
56
# File 'lib/kitchen/directions/bake_folio.rb', line 48

def create_para
  title_label = @title.search('.os-text').first.children

  @title.append(sibling:
    <<~HTML.chomp
      <p class="#{@klass}">#{title_label}</p>
    HTML
  )
end