2018-10-07 21:45:51 -04:00
|
|
|
require "factory_bot/attribute/dynamic"
|
|
|
|
require "factory_bot/attribute/association"
|
|
|
|
require "factory_bot/attribute/sequence"
|
2008-07-30 13:46:06 -04:00
|
|
|
|
2017-10-20 15:20:28 -04:00
|
|
|
module FactoryBot
|
2012-05-05 02:31:31 -04:00
|
|
|
# @api private
|
|
|
|
class Attribute
|
2011-08-20 18:05:41 -04:00
|
|
|
attr_reader :name, :ignored
|
2008-07-30 13:46:06 -04:00
|
|
|
|
2011-10-07 18:19:27 -04:00
|
|
|
def initialize(name, ignored)
|
2009-01-02 17:33:00 -05:00
|
|
|
@name = name.to_sym
|
2011-10-07 18:19:27 -04:00
|
|
|
@ignored = ignored
|
2008-07-30 13:46:06 -04:00
|
|
|
end
|
|
|
|
|
2011-11-29 15:20:08 -05:00
|
|
|
def to_proc
|
2018-09-27 21:35:05 -04:00
|
|
|
-> {}
|
2011-05-19 10:56:45 -04:00
|
|
|
end
|
2011-07-19 10:49:00 -04:00
|
|
|
|
2011-11-22 18:01:01 -05:00
|
|
|
def association?
|
|
|
|
false
|
2011-07-19 10:49:00 -04:00
|
|
|
end
|
|
|
|
|
2011-11-25 21:06:50 -05:00
|
|
|
def alias_for?(attr)
|
2017-10-20 15:20:28 -04:00
|
|
|
FactoryBot.aliases_for(attr).include?(name)
|
2011-08-08 10:03:13 -04:00
|
|
|
end
|
2011-08-13 01:03:12 -04:00
|
|
|
end
|
2008-07-30 13:46:06 -04:00
|
|
|
end
|