Sha256: 4e7264c229e0e912a5d98bf0b2fe76bddd7a6911220aadcb66152fa133a5a167
Contents?: true
Size: 597 Bytes
Versions: 6
Compression:
Stored size: 597 Bytes
Contents
module Paperdragon # 2-level meta data hash for a file. Returns empty string if not found. # Metadata.new(nil)[:original][:width] => "" # Holds metadata for an attachment. This is a hash keyed by versions, e.g. +:original+, # +:thumb+, and so on. class Metadata < Hash def self.[](hash) # allow Metadata[nil] super hash || {} end def [](name) super || {} end def populated? size > 0 end # Consider this semi-public. This is used the make the metadata hash serialisable (as a plain hash). def to_hash Hash[self] end end end
Version data entries
6 entries across 6 versions & 1 rubygems