module Resizing
Constants
- VERSION
Public Class Methods
client()
click to toggle source
# File lib/resizing.rb, line 82 def self.client if self.configure.enable_mock Resizing::MockClient.new else Resizing::Client.new end end
configure()
click to toggle source
# File lib/resizing.rb, line 31 def self.configure raise ConfigurationError, 'Resizing.configure is not initialized' unless defined? @configure @configure.dup end
configure=(new_value)
click to toggle source
# File lib/resizing.rb, line 37 def self.configure=(new_value) new_value = Configuration.new(new_value) unless new_value.is_a? Configuration @configure = new_value end
delete(name)
click to toggle source
# File lib/resizing.rb, line 58 def self.delete(name) self.client.delete name end
generate_identifier()
click to toggle source
TODO: refactoring
identifier: public_id: /projects/098a2a0d-c387-4135-a071-1254d6d7e70a/upload/images/28c49144-c00d-4cb5-8619-98ce95977b9c/v1Id850.. identifier: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ project_id: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ image_id: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ version: ^^^^^^^^^
# File lib/resizing.rb, line 74 def self.generate_identifier Resizing.configure.generate_identifier end
get(name)
click to toggle source
# File lib/resizing.rb, line 42 def self.get(name) raise NotImplementedError end
metadata(name, options)
click to toggle source
# File lib/resizing.rb, line 62 def self.metadata(name, options) self.client.metadata name, options end
post(file_or_binary, options)
click to toggle source
# File lib/resizing.rb, line 50 def self.post(file_or_binary, options) self.client.post file_or_binary, options end
put(name, file_or_binary, options)
click to toggle source
# File lib/resizing.rb, line 54 def self.put(name, file_or_binary, options) self.client.put name, file_or_binary, options end
separate_public_id(public_id)
click to toggle source
# File lib/resizing.rb, line 78 def self.separate_public_id public_id public_id.match('/projects/(?<project_id>[0-9a-f-]+)/upload/images/(?<image_id>[^/]+)(/v(?<version>[^/]+))?') end
url_from_image_id(image_id, version_id = nil, transformations = [])
click to toggle source
# File lib/resizing.rb, line 46 def self.url_from_image_id(image_id, version_id = nil, transformations = []) Resizing.configure.generate_image_url(image_id, version_id, transformations) end