Class: Docs::Header

Inherits:
Phlex::HTML
  • Object
show all
Defined in:
lib/ruby_ui/docs/header.rb

Instance Method Summary collapse

Constructor Details

#initialize(title:, description: nil) ⇒ Header

Returns a new instance of Header.



5
6
7
8
# File 'lib/ruby_ui/docs/header.rb', line 5

def initialize(title:, description: nil)
  @title = title
  @description = description
end

Instance Method Details

#view_templateObject



10
11
12
13
14
15
# File 'lib/ruby_ui/docs/header.rb', line 10

def view_template
  div do
    h1 { @title }
    p { @description } if @description
  end
end