Module: Dink::Helpers
- Includes:
- ActionView::Helpers
- Defined in:
- lib/dink/rails/helpers.rb
Instance Method Summary collapse
-
#dink!(source, process_options = {}, image_options = {}) ⇒ Object
Take image transform parameters and generate an image tag and stick it into the batch.
-
#logger ⇒ Object
- def stream_resize(image_source) b = Benchmark.measure do @params = Addressable::URI.parse(url.to_s) # TODO get URI.parse out of Addressable to remove the dependency @params.query_values = => image_source, :stream => “1” end # logger.debug { “STREAM BENCHMARK
-
#b“ }.
Instance Method Details
#dink!(source, process_options = {}, image_options = {}) ⇒ Object
Take image transform parameters and generate an image tag and stick it into the batch
6 7 8 9 10 11 |
# File 'lib/dink/rails/helpers.rb', line 6 def dink!(source, = {}, = {}) image = Dink::Image.new(source, ).deliver Rails.logger.debug{ image.inspect } # @image_batch << image image_tag(image["results"]["url"], ) end |
#logger ⇒ Object
def stream_resize(image_source)
b = Benchmark.measure do
@params = Addressable::URI.parse(url.to_s) # TODO get URI.parse out of Addressable to remove the dependency
@params.query_values = {:image_source => image_source, :stream => "1"}
end
# logger.debug { "STREAM BENCHMARK :: #{b}" }
stream_url = url
stream_url.path = "/resize"
stream_url.query = @params.query
stream_url.to_s
end
26 27 28 |
# File 'lib/dink/rails/helpers.rb', line 26 def logger Dink.configuration.logger end |