Sha256: 2f801b8da03ffa5d9d5138cb4ebd2bce5782db957b306dcf15b780d8ebc5e232
Contents?: true
Size: 694 Bytes
Versions: 3
Compression:
Stored size: 694 Bytes
Contents
module BasicBlock class TextElement TAGS = %w[em strong sub sup tt underline strike smallcap br hr keyword rp rt ruby pagebreak bookmark].freeze # # @param [String] tag # @param [Array<String, BasicBlock::TextElement, BasicBlock::Stem>, # String] content # def initialize(tag:, content:) unless TAGS.include? tag Util.warn "invalid tag `#{tag}`\nallowed tags are: `#{TAGS.join '`, `'}`" end @tag = tag @content = content end # @param [Nokogiri::XML::Builder] def to_xml(builder) builder.send @tag do |b| @content.each { |c| c.is_a?(String) ? c : c.to_xml(b) } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems