Class: GroongaClientModel::Client
- Inherits:
-
Object
- Object
- GroongaClientModel::Client
- Defined in:
- lib/groonga_client_model/client.rb
Defined Under Namespace
Modules: Notifiable
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url = nil) ⇒ Client
constructor
A new instance of Client.
- #open ⇒ Object
Constructor Details
#initialize(url = nil) ⇒ Client
Returns a new instance of Client.
28 29 30 |
# File 'lib/groonga_client_model/client.rb', line 28 def initialize(url=nil) @url = url || self.class.url || "http://127.0.0.1:10041" end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
27 28 29 |
# File 'lib/groonga_client_model/client.rb', line 27 def url @url end |
Class Method Details
.open(&block) ⇒ Object
22 23 24 |
# File 'lib/groonga_client_model/client.rb', line 22 def open(&block) new.open(&block) end |
Instance Method Details
#open ⇒ Object
32 33 34 35 36 37 |
# File 'lib/groonga_client_model/client.rb', line 32 def open Groonga::Client.open(url: @url) do |client| client.extend(Notifiable) yield(client) end end |