Class: HS::Header
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
Attributes inherited from Element
#children, #class_name, #style
Instance Method Summary collapse
-
#initialize(params) ⇒ Header
constructor
A new instance of Header.
- #tag_name ⇒ Object
Methods inherited from Element
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
#level ⇒ Object
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_name ⇒ Object
12 13 14 |
# File 'lib/hs/elements/header.rb', line 12 def tag_name "h#{level}" end |