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_girl/declaration/dynamic.rb
2012-05-05 02:31:31 -04:00

26 lines
498 B
Ruby

module FactoryGirl
class Declaration
# @api private
class Dynamic < Declaration
def initialize(name, ignored = false, block = nil)
super(name, ignored)
@block = block
end
def ==(other)
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