Sha256: 64b745845e2d372c565286607ad5e2a1a72f046e9e02aa1f0c8e64d14f3042be
Contents?: true
Size: 379 Bytes
Versions: 41
Compression:
Stored size: 379 Bytes
Contents
module Polyamorous module SwappingReflectionClass def swapping_reflection_klass(reflection, klass) new_reflection = reflection.clone new_reflection.instance_variable_set(:@options, reflection.options.clone) new_reflection.options.delete(:polymorphic) new_reflection.instance_variable_set(:@klass, klass) yield new_reflection end end end
Version data entries
41 entries across 40 versions & 7 rubygems