Sha256: a544884dd2cc9c166aa129e9eda59cac4008afbc24075b68fbd4616864920976

Contents?: true

Size: 494 Bytes

Versions: 4

Compression:

Stored size: 494 Bytes

Contents

module FactoryBot
  class Decorator < BasicObject
    undef_method :==

    def initialize(component)
      @component = component
    end

    def method_missing(...) # rubocop:disable Style/MethodMissingSuper
      @component.send(...)
    end

    def send(...)
      __send__(...)
    end

    def respond_to_missing?(name, include_private = false)
      @component.respond_to?(name, true) || super
    end

    def self.const_missing(name)
      ::Object.const_get(name)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
factory_bot-6.5.0 lib/factory_bot/decorator.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/factory_bot-6.4.6/lib/factory_bot/decorator.rb
factory_bot-6.4.6 lib/factory_bot/decorator.rb
factory_bot-6.4.5 lib/factory_bot/decorator.rb