Class: LazyFixtures::Generator
- Inherits:
-
Object
- Object
- LazyFixtures::Generator
- Includes:
- ObjectHelper
- Defined in:
- lib/lazy_fixtures/generator.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ nested: false, overwrite: false, create: true, parent: [], skip_attr: [], change_attr: {} }
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #generate(type) ⇒ Object
-
#initialize(object, options = {}) ⇒ Generator
constructor
A new instance of Generator.
Methods included from ObjectHelper
Constructor Details
#initialize(object, options = {}) ⇒ Generator
Returns a new instance of Generator.
17 18 19 20 |
# File 'lib/lazy_fixtures/generator.rb', line 17 def initialize(object, = {}) = DEFAULT_OPTIONS.merge() @object = get_object(object) end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
6 7 8 |
# File 'lib/lazy_fixtures/generator.rb', line 6 def object @object end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/lazy_fixtures/generator.rb', line 6 def end |
Instance Method Details
#generate(type) ⇒ Object
22 23 24 |
# File 'lib/lazy_fixtures/generator.rb', line 22 def generate(type) gather_class(type).new(object, ).generate end |