Class: ImageProxyRuby::Image

Inherits:
Object
  • Object
show all
Includes:
Operations::Flip, Operations::Format, Operations::Quality, Operations::RectangleCrop, Operations::Resize, Operations::Rotation, Operations::SmartCrop
Defined in:
lib/image_proxy/image.rb

Overview

represent Image with different functionalities

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Operations::Resize

#resize

Methods included from Operations::Format

#jpeg, #png, #tiff

Methods included from Operations::Quality

#quality

Methods included from Operations::Flip

#flip_horizontally, #flip_vertically

Methods included from Operations::Rotation

#rotation

Methods included from Operations::RectangleCrop

#rectangle_crop

Methods included from Operations::SmartCrop

#smart_crop

Constructor Details

#initialize(remote_url) ⇒ Image

Returns a new instance of Image.



24
25
26
27
# File 'lib/image_proxy/image.rb', line 24

def initialize(remote_url)
  @remote_url = remote_url
  @operations = []
end

Instance Attribute Details

#operationsObject

Returns the value of attribute operations.



22
23
24
# File 'lib/image_proxy/image.rb', line 22

def operations
  @operations
end

#remote_urlObject

Returns the value of attribute remote_url.



22
23
24
# File 'lib/image_proxy/image.rb', line 22

def remote_url
  @remote_url
end

Instance Method Details

#urlObject Also known as: to_s



29
30
31
32
33
# File 'lib/image_proxy/image.rb', line 29

def url
  operations_str = operations.join(',')

  "#{ImageProxyRuby.configuration.server}#{operations_str}/#{remote_url}"
end