Class: FactoryBot::Attribute Private

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_bot/attribute.rb,
lib/factory_bot/attribute/dynamic.rb,
lib/factory_bot/attribute/sequence.rb,
lib/factory_bot/attribute/association.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

Association, Dynamic, Sequence

Defined Under Namespace

Classes: Association, Dynamic, Sequence

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, ignored) ⇒ Attribute

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Attribute.



10
11
12
13
# File 'lib/factory_bot/attribute.rb', line 10

def initialize(name, ignored)
  @name = name.to_sym
  @ignored = ignored
end

Instance Attribute Details

#ignoredObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/factory_bot/attribute.rb', line 8

def ignored
  @ignored
end

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/factory_bot/attribute.rb', line 8

def name
  @name
end

Instance Method Details

#alias_for?(attr) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


23
24
25
# File 'lib/factory_bot/attribute.rb', line 23

def alias_for?(attr)
  FactoryBot.aliases_for(attr).include?(name)
end

#association?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


19
20
21
# File 'lib/factory_bot/attribute.rb', line 19

def association?
  false
end

#to_procObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/factory_bot/attribute.rb', line 15

def to_proc
  -> {}
end