module RailsConnector class CouchBlob def self.find(id, options) ActiveSupport::Notifications.instrumenter.instrument("cms_load.rails_connector", :name => "Blob Load", :index => "blobs", :keys => [options[:context]] ) do new(id, CmsBaseModel.adapter.blob_attachment(id)) end end def self.configure(spec) # connection is taken from CmsBaseModel on demand end attr_reader :id, :attachment def initialize(id, attachment) @id = id @attachment = attachment end def url CmsBaseModel.adapter.blob_url(id) end def content_type attachment["content_type"] end def length attachment['length'] end end end # module RailsConnector