class Odf::Component::ImageSet::Image

Attributes

content_type[R]
path[R]
uri[R]

Public Class Methods

new(uri) click to toggle source
# File lib/odf/component/image_set.rb, line 7
def initialize(uri)
  @uri   = uri
  digest = OpenSSL::Digest::MD5.hexdigest(uri)
  @path = "Pictures/#{digest}"
end

Public Instance Methods

content() click to toggle source
# File lib/odf/component/image_set.rb, line 17
def content
  @content || (save && @content)
end
save() click to toggle source
# File lib/odf/component/image_set.rb, line 13
def save
  @content, @content_type = Odf::Utils::File.fetch_image(self)
end