Class: Droonga::Catalog::Fetcher
- Inherits:
-
Object
- Object
- Droonga::Catalog::Fetcher
- Defined in:
- lib/droonga/catalog/fetcher.rb
Defined Under Namespace
Classes: EmptyCatalog, EmptyResponse
Instance Method Summary collapse
- #fetch(options = {}) ⇒ Object
-
#initialize(client_options) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(client_options) ⇒ Fetcher
Returns a new instance of Fetcher.
32 33 34 |
# File 'lib/droonga/catalog/fetcher.rb', line 32 def initialize() @client_options = .merge() end |
Instance Method Details
#fetch(options = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/droonga/catalog/fetcher.rb', line 36 def fetch(={}) = { "dataset" => [:dataset] || Catalog::Dataset::DEFAULT_NAME, "type" => "catalog.fetch" } response = nil Droonga::Client.open(@client_options) do |client| response = client.request() end raise EmptyResponse.new unless response raise EmptyCatalog.new unless response["body"] response["body"] end |