Skip to content

Instantly share code, notes, and snippets.

@VinceGuidry
VinceGuidry / 1-dsl.rb
Last active April 26, 2025 20:05
Ruby DSL
require 'tempfile'
# The DSL class. The render method simply takes a block, then executes the block in the scope of the DSL class. You can see
# a use of it in the next file.
module Keyd
class DSL
def self.render(&block)
d = new
d.instance_exec(&block)