Method: Paperclip::Geometry#initialize

Defined in:
lib/paperclip/geometry.rb

#initialize(width = nil, height = nil, modifier = nil) ⇒ Geometry

Gives a Geometry representing the given height and width



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/paperclip/geometry.rb', line 9

def initialize(width = nil, height = nil, modifier = nil)
  if width.is_a?(Hash)
    options = width
    @height = options[:height].to_f
    @width = options[:width].to_f
    @modifier = options[:modifier]
    @orientation = options[:orientation].to_i
  else
    @height = height.to_f
    @width  = width.to_f
    @modifier = modifier
  end
end