Sha256: 8771437f86acb4e69ead50ea3f66c5645066dd0e4e87af536cda9aee09fa9fd9

Contents?: true

Size: 462 Bytes

Versions: 3

Compression:

Stored size: 462 Bytes

Contents

# This is a nonexistent HTML tag, which holds content like a double tag but has
# no opening or closing tag. This allows us to group siblings without adding an
# extra parent to the markup.
class ShelfTag < DoubleTag
  def initialize(content: nil, oneline: false)
    self.oneline = oneline
    self.content = content
  end

  def to_a
    content.map { |c| build_content_line c }.flatten
  end

  def add_parent(parent)
    parent.add_content content
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
objective_elements-1.1.2 lib/objective_elements/shelf_tag.rb
objective_elements-1.1.1 lib/objective_elements/shelf_tag.rb
objective_elements-1.1.0 lib/objective_elements/shelf_tag.rb