module PhotoCook::Resize::Mode

Public Class Methods

check!(mode) click to toggle source
# File lib/photo-cook/resize/mode.rb, line 22
def check!(mode)
  case mode
    when :fill, :fit then true
    else raise Unknown, mode
  end
  true
end
parse(mode) click to toggle source
# File lib/photo-cook/resize/mode.rb, line 8
def parse(mode)
  case mode
    when true          then :fill
    when false         then :fit
    when :fit, :fill   then mode
    when 'fit', 'fill' then mode.to_sym
  end
end
parse!(mode) click to toggle source
# File lib/photo-cook/resize/mode.rb, line 17
def parse!(mode)
  check!(mode = parse(mode))
  mode
end