Sha256: f9f7ffe1ee4e4f9ceb373e60158620f43402733e3b4b6bfa6bc637f6a11aae58
Contents?: true
Size: 556 Bytes
Versions: 6
Compression:
Stored size: 556 Bytes
Contents
module Coradoc module Element class DocumentAttributes < Base attr_accessor :data declare_children :data def initialize(data = {}, options = {}) @data = data @options = options end def to_hash @data.to_h do |attribute| [attribute.key.to_s, attribute.value.to_s.gsub("'", "")] end end def to_adoc to_hash.map do |key, value| v = value.to_s.empty? ? "" : " #{value}" ":#{key}:#{v}\n" end.join + "\n" end end end end
Version data entries
6 entries across 6 versions & 1 rubygems