Parent

FactoryGirl::Proxy::ObjectWrapper

Public Class Methods

new(klass) click to toggle source
# File lib/factory_girl/proxy.rb, line 92
def initialize(klass)
  @klass      = klass
  @attributes = []
  @cached_attribute_values = {}
end

Public Instance Methods

get(attribute) click to toggle source
# File lib/factory_girl/proxy.rb, line 120
def get(attribute)
  @cached_attribute_values[attribute] ||= anonymous_instance.send(attribute)
end
object() click to toggle source
# File lib/factory_girl/proxy.rb, line 105
def object
  @object ||= @klass.new
  assign_object_attributes
  @object
end
set(attribute, value) click to toggle source
# File lib/factory_girl/proxy.rb, line 111
def set(attribute, value)
  define_attribute(attribute, value)
  @attributes << attribute.name
end
set_ignored(attribute, value) click to toggle source
# File lib/factory_girl/proxy.rb, line 116
def set_ignored(attribute, value)
  define_attribute(attribute, value)
end
to_hash() click to toggle source
# File lib/factory_girl/proxy.rb, line 98
def to_hash
  @attributes.inject({}) do |result, attribute|
    result[attribute] = get(attribute)
    result
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.