lib/signore/signature.rb in signore-0.4.0 vs lib/signore/signature.rb in signore-0.4.1

- old
+ new

@@ -5,9 +5,13 @@ def initialize(author: nil, source: nil, subject: nil, tags: nil, text: nil) super text, author, source, subject, tags each_pair { |key, value| self[key] = nil if value and value.empty? } end + def text + self[:text] or '' + end + def to_h super.map { |key, val| [key.to_s, val] }.to_h.keep_if { |_, value| value } end def to_s