Class: Deploio::PgDatabaseRef

Inherits:
Object
  • Object
show all
Defined in:
lib/deploio/pg_database_ref.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, available_databases: {}) ⇒ PgDatabaseRef

The input is given in the format "-"



10
11
12
13
# File 'lib/deploio/pg_database_ref.rb', line 10

def initialize(input, available_databases: {})
  @input = input.to_s
  parse_from_available_databases(available_databases)
end

Instance Attribute Details

#database_nameObject (readonly)

Returns the value of attribute database_name.



7
8
9
# File 'lib/deploio/pg_database_ref.rb', line 7

def database_name
  @database_name
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



7
8
9
# File 'lib/deploio/pg_database_ref.rb', line 7

def project_name
  @project_name
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
26
27
# File 'lib/deploio/pg_database_ref.rb', line 23

def ==(other)
  return false unless other.is_a?(PgDatabaseRef)

  project_name == other.project_name && database_name == other.database_name
end

#full_nameObject



15
16
17
# File 'lib/deploio/pg_database_ref.rb', line 15

def full_name
  "#{project_name}-#{database_name}"
end

#to_sObject



19
20
21
# File 'lib/deploio/pg_database_ref.rb', line 19

def to_s
  full_name
end