Class: Couchbase::PingResult

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/diagnostics.rb

Defined Under Namespace

Classes: ServiceInfo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|self| ... } ⇒ PingResult

Returns a new instance of PingResult.

Yield Parameters:



165
166
167
168
# File 'lib/couchbase/diagnostics.rb', line 165

def initialize
  @services = {}
  yield self if block_given?
end

Instance Attribute Details

#idString

Returns report id.

Returns:

  • (String)

    report id



147
148
149
# File 'lib/couchbase/diagnostics.rb', line 147

def id
  @id
end

#sdkString

Returns SDK identifier.

Returns:

  • (String)

    SDK identifier



150
151
152
# File 'lib/couchbase/diagnostics.rb', line 150

def sdk
  @sdk
end

#servicesHash<Symbol, ServiceInfo>

Returns information about currently service endpoints, that known to the library at the moment.

:kv

Key/Value data service

:query

N1QL query service

:analytics

Analtyics service

:search

Full text search service

:views

Views service

:mgmt

Management service

Returns:

  • (Hash<Symbol, ServiceInfo>)

    map service types to info



162
163
164
# File 'lib/couchbase/diagnostics.rb', line 162

def services
  @services
end

Instance Method Details

#to_json(*args) ⇒ Object



174
175
176
177
178
179
180
181
# File 'lib/couchbase/diagnostics.rb', line 174

def to_json(*args)
  {
    version: @version,
    id: @id,
    sdk: @sdk,
    services: @services,
  }.to_json(*args)
end