class Paperdragon::Metadata

2-level meta data hash for a file. Returns empty string if not found. Metadata.new(nil)[:width] => “” Holds metadata for an attachment. This is a hash keyed by versions, e.g. :original, :thumb, and so on.

Public Class Methods

[](hash) click to toggle source
Calls superclass method
# File lib/paperdragon/metadata.rb, line 7
def self.[](hash) # allow Metadata[nil]
  super hash || {}
end

Public Instance Methods

[](name) click to toggle source
Calls superclass method
# File lib/paperdragon/metadata.rb, line 11
def [](name)
  super || {}
end
populated?() click to toggle source
# File lib/paperdragon/metadata.rb, line 15
def populated?
  size > 0
end
to_hash() click to toggle source

Consider this semi-public. This is used the make the metadata hash serialisable (as a plain hash).

# File lib/paperdragon/metadata.rb, line 20
def to_hash
  Hash[self]
end