Class: Droonga::CatalogFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/catalog_fetcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(client_options) ⇒ CatalogFetcher

Returns a new instance of CatalogFetcher.



25
26
27
# File 'lib/droonga/catalog_fetcher.rb', line 25

def initialize(client_options)
  @client_options = default_options.merge(client_options)
end

Instance Method Details

#fetch(options = {}) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/droonga/catalog_fetcher.rb', line 29

def fetch(options={})
  message = {
    "dataset" => options[:dataset] || Catalog::Dataset::DEFAULT_NAME,
    "type"    => "catalog.fetch"
  }
  Droonga::Client.open(@client_options) do |client|
    response = client.request(message)
    response["body"]
  end
end