class FactoryGirl::AttributeList

@api private

Public Class Methods

new(name = nil, attributes = []) click to toggle source
# File lib/factory_girl/attribute_list.rb, line 6
def initialize(name = nil, attributes = [])
  @name       = name
  @attributes = attributes
end

Public Instance Methods

apply_attributes(attributes_to_apply) click to toggle source
# File lib/factory_girl/attribute_list.rb, line 38
def apply_attributes(attributes_to_apply)
  attributes_to_apply.each {|attribute| add_attribute(attribute) }
end
associations() click to toggle source
# File lib/factory_girl/attribute_list.rb, line 26
def associations
  AttributeList.new(@name, select(&:association?))
end
define_attribute(attribute) click to toggle source
# File lib/factory_girl/attribute_list.rb, line 11
def define_attribute(attribute)
  ensure_attribute_not_self_referencing! attribute
  ensure_attribute_not_defined! attribute

  add_attribute attribute
end
each(&block) click to toggle source
# File lib/factory_girl/attribute_list.rb, line 18
def each(&block)
  @attributes.each(&block)
end
ignored() click to toggle source
# File lib/factory_girl/attribute_list.rb, line 30
def ignored
  AttributeList.new(@name, select(&:ignored))
end
names() click to toggle source
# File lib/factory_girl/attribute_list.rb, line 22
def names
  map(&:name)
end
non_ignored() click to toggle source
# File lib/factory_girl/attribute_list.rb, line 34
def non_ignored
  AttributeList.new(@name, reject(&:ignored))
end