Sha256: 900b114120ff663b4e263d5611683a7a79ae7f2d5ac26e56f087113d04c223ac

Contents?: true

Size: 438 Bytes

Versions: 3

Compression:

Stored size: 438 Bytes

Contents

module Bogus
  class AddsRecording
    extend Takes

    takes :converts_name_to_class, :create_proxy_class, :overwrites_classes,
      :overwritten_classes

    def add(name, klass = nil)
      klass ||= converts_name_to_class.convert(name)
      new_klass = create_proxy_class.call(name, klass)
      overwrites_classes.overwrite(klass.name, new_klass)
      overwritten_classes.add(klass.name, klass)
      new_klass
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bogus-0.1.3 lib/bogus/adds_recording.rb
bogus-0.1.2 lib/bogus/adds_recording.rb
bogus-0.1.1 lib/bogus/adds_recording.rb