lib/alephant/broker/models/response/asset_response.rb in alephant-broker-0.1.1 vs lib/alephant/broker/models/response/asset_response.rb in alephant-broker-0.1.2
- old
+ new
@@ -39,34 +39,28 @@
self.status = status
self.content = exception.message
end
def s3_path
- lookup.read(id, request.options, version).tap { |cache_id| raise InvalidCacheKey if cache_id.nil? }
+ lookup.read(component_id, request.options, version).tap do |lookup_object|
+ raise InvalidCacheKey if lookup_object.location.nil?
+ end.location unless version.nil?
end
def lookup
@lookup ||= Alephant::Lookup.create(config[:lookup_table_name])
end
- def asset?
- request.type == :asset
- end
-
def key
- asset? ? component_key : renderer_key
+ request.type == :batch ? renderer_key : component_key
end
def component_key
"#{component_id}/#{opts_hash}"
end
def renderer_key
"#{renderer_id}/#{opts_hash}"
- end
-
- def id
- asset? ? component_id : renderer_id
end
def component_id
request.component_id
end