Sha256: 373233c958167993581c61e24753bec00e0a81be311af63a8e241cc675890871
Contents?: true
Size: 448 Bytes
Versions: 15
Compression:
Stored size: 448 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
15 entries across 15 versions & 1 rubygems