Class: HS::Header

Inherits:
Element show all
Defined in:
lib/hs/elements/header.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#children, #class_name, #style

Instance Method Summary collapse

Methods inherited from Element

#params, #preview

Methods included from ElementPreview

#element_preview, #text_preview

Constructor Details

#initialize(params) ⇒ Header

Returns a new instance of Header.



7
8
9
10
# File 'lib/hs/elements/header.rb', line 7

def initialize(params)
  super
  @level ||= 1
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



5
6
7
# File 'lib/hs/elements/header.rb', line 5

def level
  @level
end

Instance Method Details

#tag_nameObject



12
13
14
# File 'lib/hs/elements/header.rb', line 12

def tag_name
  "h#{level}"
end