Class: PgObjects::DbObject

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_objects/db_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



3
4
5
# File 'lib/pg_objects/db_object.rb', line 3

def dependencies
  @dependencies
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/pg_objects/db_object.rb', line 3

def name
  @name
end

#sql_queryObject (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

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/pg_objects/db_object.rb', line 4

def status
  @status
end