Class: Groonga::DatabaseInspector

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga/database-inspector.rb

Overview

It is a class that inspects database. You can know details metadata of the database.

Defined Under Namespace

Classes: Options

Instance Method Summary collapse

Constructor Details

#initialize(database, options = nil) ⇒ DatabaseInspector

Returns a new instance of DatabaseInspector.

Parameters:

  • database (Database)

    The database to be inspected.

  • options (Options) (defaults to: nil)

    The options to custom this inspector behavior.



24
25
26
27
# File 'lib/groonga/database-inspector.rb', line 24

def initialize(database, options=nil)
  @database = database
  @options = options || Options.new
end

Instance Method Details

#report(output = nil) ⇒ Object

Report inspected result of the database.

Parameters:

  • output (#write) (defaults to: nil)

    (nil) The output of inspected result. If it is @nil@, @$stdout@ is used.



33
34
35
36
37
# File 'lib/groonga/database-inspector.rb', line 33

def report(output=nil)
  output ||= $stdout
  reporter = Reporter.new(@database, @options, output)
  reporter.report
end