Class: PgObjects::DbObject
- Inherits:
-
Object
- Object
- PgObjects::DbObject
- Defined in:
- lib/pg_objects/db_object.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sql_query ⇒ Object
readonly
Returns the value of attribute sql_query.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ DbObject
constructor
A new instance of DbObject.
Constructor Details
#initialize(file_path) ⇒ DbObject
Returns a new instance of DbObject.
6 7 8 9 10 11 12 |
# File 'lib/pg_objects/db_object.rb', line 6 def initialize(file_path) @name = File.basename file_path, '.*' @sql_query = File.read file_path @dependencies = Parser.fetch_dependencies @sql_query @status = :pending end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
3 4 5 |
# File 'lib/pg_objects/db_object.rb', line 3 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/pg_objects/db_object.rb', line 3 def name @name end |
#sql_query ⇒ Object (readonly)
Returns the value of attribute sql_query.
3 4 5 |
# File 'lib/pg_objects/db_object.rb', line 3 def sql_query @sql_query end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/pg_objects/db_object.rb', line 4 def status @status end |