Class: Couchbase::Options::Ping

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

Overview

Options for Bucket#ping

Constant Summary collapse

DEFAULT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Ping.new.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_id: nil, service_types: [:kv, :query, :analytics, :search, :views, :management], timeout: nil) {|self| ... } ⇒ Ping

Creates an instance of options for Bucket#ping

@@param [Array<Symbol>] service_types The service types to limit this diagnostics request

Parameters:

  • report_id (String) (defaults to: nil)

    Holds custom report id.

  • timeout (Integer, #in_milliseconds) (defaults to: nil)

Yield Parameters:



1828
1829
1830
1831
1832
1833
1834
1835
# File 'lib/couchbase/options.rb', line 1828

def initialize(report_id: nil,
               service_types: [:kv, :query, :analytics, :search, :views, :management],
               timeout: nil)
  @report_id = report_id
  @service_types = service_types
  @timeout = timeout
  yield self if block_given?
end

Instance Attribute Details

#report_idString

Returns:

  • (String)


1817
1818
1819
# File 'lib/couchbase/options.rb', line 1817

def report_id
  @report_id
end

#service_typesArray<Symbol>

Returns:

  • (Array<Symbol>)


1818
1819
1820
# File 'lib/couchbase/options.rb', line 1818

def service_types
  @service_types
end

#timeoutInteger, #in_milliseconds

Returns:

  • (Integer, #in_milliseconds)


1819
1820
1821
# File 'lib/couchbase/options.rb', line 1819

def timeout
  @timeout
end

Instance Method Details

#to_backendObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1838
1839
1840
1841
1842
1843
1844
# File 'lib/couchbase/options.rb', line 1838

def to_backend
  {
    timeout: Utils::Time.extract_duration(@timeout),
    service_types: @service_types,
    report_id: @report_id,
  }
end