Class: Gratan::Exporter
- Inherits:
-
Object
- Object
- Gratan::Exporter
- Defined in:
- lib/gratan/exporter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(driver, options = {}) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
#initialize(driver, options = {}) ⇒ Exporter
Returns a new instance of Exporter.
6 7 8 9 |
# File 'lib/gratan/exporter.rb', line 6 def initialize(driver, = {}) @driver = driver = end |
Class Method Details
.export(driver, options = {}, &block) ⇒ Object
2 3 4 |
# File 'lib/gratan/exporter.rb', line 2 def self.export(driver, = {}, &block) self.new(driver, ).export(&block) end |
Instance Method Details
#export ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gratan/exporter.rb', line 11 def export grants = [] @driver.each_user do |user, host| next if user =~ [:ignore_user] @driver.show_grants(user, host) do |stmt| grants << Gratan::GrantParser.parse(stmt) end end pack(grants) end |