Sha256: 26d80eeaa10d4723d8b6a33e51312f1e4a87ba480458f7c9642a36b51ce043aa
Contents?: true
Size: 450 Bytes
Versions: 33
Compression:
Stored size: 450 Bytes
Contents
# frozen_string_literal = true class Ree::ErrorDsl def execute(klass, &proc) self.class.instance_exec(&proc) rescue NameError => e proc .binding .eval("#{e.name} = Ree::ErrorDsl::ClassConstant.new('#{e.name}')") retry end class ClassConstant attr_reader :name, :message def initialize(name) @name = name @message = nil end def [](msg) @message = msg self end end end
Version data entries
33 entries across 33 versions & 1 rubygems