Class: PgObjects::Manager
- Inherits:
-
Object
- Object
- PgObjects::Manager
- Defined in:
- lib/pg_objects/manager.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
Instance Method Summary collapse
- #create_objects ⇒ Object
-
#initialize ⇒ Manager
constructor
A new instance of Manager.
- #load_files ⇒ Object
Constructor Details
#initialize ⇒ Manager
Returns a new instance of Manager.
5 6 7 8 9 10 11 |
# File 'lib/pg_objects/manager.rb', line 5 def initialize raise UnsupportedAdapterError if ActiveRecord::Base.connection.adapter_name != 'PostgreSQL' @objects = [] @config = PgObjects.config @log = Logger.new(config.silent) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/pg_objects/manager.rb', line 3 def config @config end |
#log ⇒ Object (readonly)
Returns the value of attribute log.
3 4 5 |
# File 'lib/pg_objects/manager.rb', line 3 def log @log end |
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
3 4 5 |
# File 'lib/pg_objects/manager.rb', line 3 def objects @objects end |
Instance Method Details
#create_objects ⇒ Object
23 24 25 |
# File 'lib/pg_objects/manager.rb', line 23 def create_objects @objects.each { |obj| create_object obj } end |