module Magick::RVG::PreserveAspectRatio
def preserve_aspect_ratio(align, meet_or_slice = 'meet')
'YMin', 'YMid', or 'YMax'
[+align+] a combination of 'xMin', 'xMid', or 'xMax', followed by
Specifies how the image within a viewport should be scaled.
++
Included in Stretchable module and Image class
--
def preserve_aspect_ratio(align, meet_or_slice = 'meet') @align = align.to_s if @align != 'none' m = /\A(xMin|xMid|xMax)(YMin|YMid|YMax)\z/.match(@align) raise(ArgumentError, "unknown alignment specifier: #{@align}") unless m end if meet_or_slice meet_or_slice = meet_or_slice.to_s.downcase raise(ArgumentError, "specifier must be `meet' or `slice' (got #{meet_or_slice})") unless %w[meet slice].include?(meet_or_slice) @meet_or_slice = meet_or_slice end yield(self) if block_given? self end