Sha256: 25b46e57a7a43d50a0d02a41d0702b3598a67740a0c4f9cb582a2fc1e1c13614
Contents?: true
Size: 562 Bytes
Versions: 11
Compression:
Stored size: 562 Bytes
Contents
module EDN module Metadata def self.extended(base) base.instance_eval do alias :to_edn_without_metadata :to_edn alias :to_edn :to_edn_with_metadata end end attr_accessor :metadata def has_metadata? respond_to?(:allows_metadata?) and allows_metadata? and !metadata.nil? and !metadata.empty? end def to_edn_with_metadata if has_metadata? '^' + metadata.to_edn + ' ' + to_edn_without_metadata else to_edn_without_metadata end end end end
Version data entries
11 entries across 11 versions & 2 rubygems