Class: ImageServer::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/image_server/image.rb

Instance Method Summary collapse

Constructor Details

#initialize(namespace, image_hash, protocol: 'http://', domain: nil, size: nil, format: nil, processing: false, object: nil, default_size: nil) ⇒ Image

Returns a new instance of Image.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/image_server/image.rb', line 4

def initialize(namespace, image_hash, protocol: 'http://', domain: nil, size: nil, format: nil, processing: false, object: nil, default_size: nil)
  @namespace = namespace
  @image_hash = image_hash
  @protocol = protocol
  @domain = domain
  @size = size
  @format = format
  @processing = processing
  @object = object
  @default_size = default_size
end

Instance Method Details

#url(options = {}) ⇒ Object



16
17
18
19
# File 'lib/image_server/image.rb', line 16

def url(options = {})
  options = options.merge({ processing: @processing })
  image_url_for_version(@default_size, options)
end