Class: PgObjects::DbObjectFactory
- Inherits:
-
Object
- Object
- PgObjects::DbObjectFactory
- Defined in:
- lib/pg_objects/db_object_factory.rb
Overview
Factory for DbObject
Each DbObject gets its own Parser instance so the parser's mutable @source
is never shared between objects. The parser class is
injectable so callers/tests can substitute an alternate parser.
Instance Method Summary collapse
- #create_instance(path, status: :new) ⇒ Object
-
#initialize(parser_class: PgObjects::Parser) ⇒ DbObjectFactory
constructor
A new instance of DbObjectFactory.
Constructor Details
#initialize(parser_class: PgObjects::Parser) ⇒ DbObjectFactory
Returns a new instance of DbObjectFactory.
10 11 12 |
# File 'lib/pg_objects/db_object_factory.rb', line 10 def initialize(parser_class: PgObjects::Parser) @parser_class = parser_class end |