Class: Pgchief::Command::StoreConnectionString

Inherits:
Object
  • Object
show all
Defined in:
lib/pgchief/command/store_connection_string.rb

Overview

Class to store connection string

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection_string) ⇒ StoreConnectionString

Returns a new instance of StoreConnectionString.



13
14
15
# File 'lib/pgchief/command/store_connection_string.rb', line 13

def initialize(connection_string)
  @connection_string = connection_string
end

Instance Attribute Details

#connection_stringObject (readonly)

Returns the value of attribute connection_string.



11
12
13
# File 'lib/pgchief/command/store_connection_string.rb', line 11

def connection_string
  @connection_string
end

Class Method Details

.call(connection_string) ⇒ Object



7
8
9
# File 'lib/pgchief/command/store_connection_string.rb', line 7

def self.call(connection_string)
  new(connection_string).call
end

Instance Method Details

#callObject



17
18
19
20
21
# File 'lib/pgchief/command/store_connection_string.rb', line 17

def call
  File.open(Config.credentials_file, 'a') do |file|
    file.puts @connection_string
  end
end