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