class Magick::Draw

def pattern(name, x, y, width, height)

as the argument to the 'fill' or 'stroke' methods
draw the pattern. Reference the pattern by using its name
Define a pattern. In the block, call primitive methods to
def pattern(name, x, y, width, height)
    begin
        push('defs')
        push("pattern #{name} #{x} #{y} #{width} #{height}")
        push('graphic-context')
        yield
    ensure
        pop('graphic-context')
        pop('pattern')
        pop('defs')
    end
end