mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
26 lines
498 B
Ruby
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
|