Module: MR::Factory::Config::InstanceMethods

Defined in:
lib/mr/factory/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#object_classObject (readonly)

Returns the value of attribute object_class.



15
16
17
# File 'lib/mr/factory/config.rb', line 15

def object_class
  @object_class
end

Instance Method Details

#apply_args(object, args) ⇒ Object

make the methods lazy-eval’d so factories can be built without paying the performance of them building out their config, this makes it less costly to require real and fake factories together in a test suite (i.e. we don’t want to split our real and fake factories into separate files)



27
28
29
30
31
# File 'lib/mr/factory/config.rb', line 27

def apply_args(object, args)
  apply_default_args(object)
  apply_args_from_hash(object, args)
  true
end

#initialize(object_class) ⇒ Object



17
18
19
# File 'lib/mr/factory/config.rb', line 17

def initialize(object_class)
  @object_class = object_class
end

#set_default_args(&block) ⇒ Object



33
34
35
# File 'lib/mr/factory/config.rb', line 33

def set_default_args(&block)
  @default_args_proc = block
end