Sha256: 0096c1ea657f5e62245cc62f2bd151e998c35f096fc50233950d5c2fc10e335b

Contents?: true

Size: 639 Bytes

Versions: 1

Compression:

Stored size: 639 Bytes

Contents

module RailsConnector

# TODO Caching:
# unlimited urls: ewig
# limited urls: zeitlimit - x (x fuer mindestverwendbarkeitszeit)
class Blob

  class << self

    def configure(config)
    end

    def find(id)
      new(id)
    end

  end

  attr_reader :id

  def initialize(id)
    @id = id
  end

  def url
    raw_data["url"]
  end

  def content_type
    meta_data[:content_type]
  end

  def length
    meta_data[:content_length].to_i
  end

  private

  def raw_data
    @raw_data ||= CmsBackend.instance.find_blob_data_by_id(id)
  end

  def meta_data
    @meta_data ||= RestClient.head(raw_data["meta_url"]).headers
  end
end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
infopark_cloud_connector-7.1.0 lib/rails_connector/blob.rb