Class: Posgra::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/posgra/exporter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, options = {}) ⇒ Exporter

Returns a new instance of Exporter.



14
15
16
17
# File 'lib/posgra/exporter.rb', line 14

def initialize(driver, options = {})
  @driver = driver
  @options = options
end

Class Method Details

.export_databases(driver, options = {}) ⇒ Object



10
11
12
# File 'lib/posgra/exporter.rb', line 10

def self.export_databases(driver, options = {})
  self.new(driver, options).export_databases
end

.export_grants(driver, options = {}) ⇒ Object



6
7
8
# File 'lib/posgra/exporter.rb', line 6

def self.export_grants(driver, options = {})
  self.new(driver, options).export_grants
end

.export_roles(driver, options = {}) ⇒ Object



2
3
4
# File 'lib/posgra/exporter.rb', line 2

def self.export_roles(driver, options = {})
  self.new(driver, options).export_roles
end

Instance Method Details

#export_databasesObject



30
31
32
# File 'lib/posgra/exporter.rb', line 30

def export_databases
  @driver.describe_databases
end

#export_grantsObject



26
27
28
# File 'lib/posgra/exporter.rb', line 26

def export_grants
  @driver.describe_grants
end

#export_rolesObject



19
20
21
22
23
24
# File 'lib/posgra/exporter.rb', line 19

def export_roles
  {
    :users => @driver.describe_users.keys,
    :users_by_group => @driver.describe_groups,
  }
end