Sha256: 47cd742ecca418afbe2a0ed1223d7ca3e4e5869cd01a9ed2f3c541a0f9aa7462
Contents?: true
Size: 660 Bytes
Versions: 10
Compression:
Stored size: 660 Bytes
Contents
module FactoryBot # @api private class Trait attr_reader :name, :definition def initialize(name, &block) @name = name.to_s @block = block @definition = Definition.new(@name) proxy = FactoryBot::DefinitionProxy.new(@definition) if block proxy.instance_eval(&@block) end end delegate :add_callback, :declare_attribute, :to_create, :define_trait, :constructor, :callbacks, :attributes, :klass, :klass=, to: :@definition def names [@name] end def ==(other) name == other.name && block == other.block end protected attr_reader :block end end
Version data entries
10 entries across 9 versions & 3 rubygems