1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/lib/factory_bot/declaration/dynamic.rb

29 lines
537 B
Ruby
Raw Normal View History

module FactoryBot
class Declaration
2012-05-05 02:31:31 -04:00
# @api private
class Dynamic < Declaration
def initialize(name, ignored = false, block = nil)
super(name, ignored)
@block = block
end
def ==(other)
self.class == other.class &&
name == other.name &&
ignored == other.ignored &&
block == other.block
end
protected
attr_reader :block
private
def build
[Attribute::Dynamic.new(name, @ignored, @block)]
end
end
end
end