module Imgproxy::OptionsCasters::Trim

Casts trim option

Constants

CASTER

Public Class Methods

cast(raw) click to toggle source
# File lib/imgproxy/options_casters/trim.rb, line 17
def self.cast(raw)
  # Allow trim to be just a numeric
  return Imgproxy::OptionsCasters::Float.cast(raw) if raw.is_a?(Numeric)

  return raw unless raw.is_a?(Hash)
  return unless raw[:threshold]

  CASTER.cast(raw)
end