Class: DragonflyLibvips::Dimensions

Inherits:
Struct
  • Object
show all
Defined in:
lib/dragonfly_libvips/dimensions.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#geometryObject

Returns the value of attribute geometry

Returns:

  • (Object)

    the current value of geometry



2
3
4
# File 'lib/dragonfly_libvips/dimensions.rb', line 2

def geometry
  @geometry
end

#orig_hObject

Returns the value of attribute orig_h

Returns:

  • (Object)

    the current value of orig_h



2
3
4
# File 'lib/dragonfly_libvips/dimensions.rb', line 2

def orig_h
  @orig_h
end

#orig_wObject

Returns the value of attribute orig_w

Returns:

  • (Object)

    the current value of orig_w



2
3
4
# File 'lib/dragonfly_libvips/dimensions.rb', line 2

def orig_w
  @orig_w
end

Class Method Details

.call(*args) ⇒ Object



3
4
5
# File 'lib/dragonfly_libvips/dimensions.rb', line 3

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



7
8
9
10
# File 'lib/dragonfly_libvips/dimensions.rb', line 7

def call
  return OpenStruct.new(width: orig_w, height: orig_h, scale: 1) if do_not_resize_if_image_smaller_than_requested? || do_not_resize_if_image_larger_than_requested?
  OpenStruct.new(width: width, height: height, scale: scale)
end