Class: MiddlemanToc::Tag

Inherits:
Struct
  • Object
show all
Defined in:
lib/middleman_toc/tag.rb

Defined Under Namespace

Classes: Attr

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attrs=(value) ⇒ Object

Sets the attribute attrs

Parameters:

  • value (Object)

    the value to set the attribute attrs to.

Returns:

  • (Object)

    the newly set value



2
3
4
# File 'lib/middleman_toc/tag.rb', line 2

def attrs=(value)
  @attrs = value
end

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



2
3
4
# File 'lib/middleman_toc/tag.rb', line 2

def content
  @content
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/middleman_toc/tag.rb', line 2

def name
  @name
end

Instance Method Details

#renderObject



6
7
8
# File 'lib/middleman_toc/tag.rb', line 6

def render
  "<#{name} #{attrs}".strip + ">\n#{indent(content)}\n</#{name}>"
end