class Magick::OptionalMethodArguments
Collects non-specific optional method arguments
Public Class Methods
Source
# File lib/rmagick_internal.rb, line 1876 def initialize(img) @img = img @artifacts = {} end
Public Instance Methods
Source
# File lib/rmagick_internal.rb, line 1887 def define(key, val = nil) key = -String(key) val = -String(val) unless val.nil? raise ArgumentError, 'string contains null byte' if key.include?("\0") || val&.include?("\0") @artifacts[key] = val val end
set(key, val) corresponds to -set option:key val
Source
# File lib/rmagick_internal.rb, line 1897 def highlight_color=(color) define_compare_color('highlight-color', color) end
accepts Pixel object or color name
Source
# File lib/rmagick_internal.rb, line 1902 def lowlight_color=(color) define_compare_color('lowlight-color', color) end
accepts Pixel object or color name
Source
# File lib/rmagick_internal.rb, line 1882 def method_missing(mth, val) define(mth.to_s.tr('_', '-'), val) end
miscellaneous options like -verbose
Private Instance Methods
Source
# File lib/rmagick_internal.rb, line 1908 def define_compare_color(name, color) color = if color.is_a?(Magick::Pixel) color.to_color(Magick::AllCompliance, true) else String.try_convert(color) || raise(TypeError, "argument must be color name or pixel (#{color.class} given)") end define("compare:#{name}", color) # ImageMagick 6.9.6-0 and older read the name without the "compare:" prefix. define(name, color) end