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/attribute.rb

23 lines
306 B
Ruby
Raw Normal View History

class Factory
class Attribute #:nodoc:
attr_reader :name
attr_writer :static_value, :lazy_block
def initialize (name)
@name = name
end
def value (proxy)
if @lazy_block.nil?
@static_value
else
@lazy_block.call(proxy)
end
end
end
end