Class: Couchbase::Cluster::AnalyticsOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/analytics_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/analytics_options.rb
more...

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of AnalyticsOptions.

Yield Parameters:

[View source]

43
44
45
46
47
48
49
50
# File 'lib/couchbase/analytics_options.rb', line 43

def initialize
  @transcoder = JsonTranscoder.new
  @raw_parameters = {}
  @positional_parameters = nil
  @named_parameters = nil
  @scan_consistency = nil
  yield self if block_given?
end

Instance Attribute Details

#client_context_idString

Returns Provides a custom client context ID for this query.

Returns:

  • (String)

    Provides a custom client context ID for this query


24
25
26
# File 'lib/couchbase/analytics_options.rb', line 24

def client_context_id
  @client_context_id
end

#priorityBoolean

Returns Allows to give certain requests higher priority than others.

Returns:

  • (Boolean)

    Allows to give certain requests higher priority than others


33
34
35
# File 'lib/couchbase/analytics_options.rb', line 33

def priority
  @priority
end

#readonlyBoolean

Returns Allows explicitly marking a query as being readonly and not mutating any documents on the server side.

Returns:

  • (Boolean)

    Allows explicitly marking a query as being readonly and not mutating any documents on the server side.


30
31
32
# File 'lib/couchbase/analytics_options.rb', line 30

def readonly
  @readonly
end

#scan_consistency:not_bounded, :request_plus

Returns specifies level of consistency for the query.

Returns:

  • (:not_bounded, :request_plus)

    specifies level of consistency for the query


27
28
29
# File 'lib/couchbase/analytics_options.rb', line 27

def scan_consistency
  @scan_consistency
end

#timeoutInteger

Returns Timeout in milliseconds.

Returns:

  • (Integer)

    Timeout in milliseconds


21
22
23
# File 'lib/couchbase/analytics_options.rb', line 21

def timeout
  @timeout
end

#transcoderJsonTranscoder

Returns transcoder to use on rows.

Returns:


36
37
38
# File 'lib/couchbase/analytics_options.rb', line 36

def transcoder
  @transcoder
end

Instance Method Details

#named_parameters(named) ⇒ Object

Sets named parameters for the query

Parameters:

  • named (Hash)

    the key/value map of the parameters to substitute in the statement

[View source]

69
70
71
72
# File 'lib/couchbase/analytics_options.rb', line 69

def named_parameters(named)
  @named_parameters = named
  @positional_parameters = nil
end

#positional_parameters(positional) ⇒ Object

Sets positional parameters for the query

Parameters:

  • positional (Array)

    the list of parameters that have to be substituted in the statement

[View source]

55
56
57
58
# File 'lib/couchbase/analytics_options.rb', line 55

def positional_parameters(positional)
  @positional_parameters = positional
  @named_parameters = nil
end

#raw(key, value) ⇒ Object

Allows providing custom JSON key/value pairs for advanced usage

Parameters:

  • key (String)

    the parameter name (key of the JSON property)

  • value (Object)

    the parameter value (value of the JSON property)

[View source]

78
79
80
# File 'lib/couchbase/analytics_options.rb', line 78

def raw(key, value)
  @raw_parameters[key] = JSON.generate(value)
end