Sha256: 38d2b8a20d3597b5411d3f33a79b084cc9d547304ca473cb3ad6c040ba3333d3

Contents?: true

Size: 630 Bytes

Versions: 10

Compression:

Stored size: 630 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.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

10 entries across 10 versions & 1 rubygems

Version Path
infopark_cloud_connector-7.0.2 lib/rails_connector/blob.rb
infopark_cloud_connector-7.0.1 lib/rails_connector/blob.rb
infopark_cloud_connector-7.0.0 lib/rails_connector/blob.rb
infopark_cloud_connector-6.9.5 lib/rails_connector/blob.rb
infopark_cloud_connector-6.9.4 lib/rails_connector/blob.rb
infopark_cloud_connector-6.9.3.1.36404185 lib/rails_connector/blob.rb
infopark_cloud_connector-6.9.2.1.125136549 lib/rails_connector/blob.rb
infopark_cloud_connector-6.9.1.3.22208381 lib/rails_connector/blob.rb
infopark_cloud_connector-6.9.0.3.197272233 lib/rails_connector/blob.rb
infopark_cloud_connector-6.8.3.174.51542603 lib/rails_connector/blob.rb