Sha256: 84b648a45ec34af62328385325d82499abf84d4cb17bd90cf8d69cace04b76ed
Contents?: true
Size: 613 Bytes
Versions: 60
Compression:
Stored size: 613 Bytes
Contents
# frozen_string_literal: true require 'ibrain/core/class_constantizer' module Ibrain module Core module EnvironmentExtension extend ActiveSupport::Concern class_methods do def add_class_set(name) define_method(name) do set = instance_variable_get("@#{name}") set ||= send("#{name}=", []) set end define_method("#{name}=") do |klasses| set = ClassConstantizer::Set.new set.concat(klasses) instance_variable_set("@#{name}", set) end end end end end end
Version data entries
60 entries across 60 versions & 1 rubygems