Class: Couchbase::Options::Analytics
- Defined in:
- lib/couchbase/options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/options.rb more...
Overview
Options for Cluster#analytics_query
Instance Attribute Summary collapse
- #client_context_id ⇒ String
- #priority ⇒ Boolean
- #readonly ⇒ Boolean
- #scan_consistency ⇒ Symbol
- #transcoder ⇒ JsonTranscoder, #decode(String)
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#initialize(client_context_id: nil, scan_consistency: nil, readonly: false, priority: nil, transcoder: JsonTranscoder.new, positional_parameters: nil, named_parameters: nil, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Analytics
constructor
Creates new instance of options for Cluster#analytics_query.
-
#named_parameters(named) ⇒ Object
Sets named parameters for the query.
-
#positional_parameters(positional) ⇒ Object
Sets positional parameters for the query.
-
#raw(key, value) ⇒ Object
Allows providing custom JSON key/value pairs for advanced usage.
Constructor Details
#initialize(client_context_id: nil, scan_consistency: nil, readonly: false, priority: nil, transcoder: JsonTranscoder.new, positional_parameters: nil, named_parameters: nil, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Analytics
Note:
Either positional_parameters
or named_parameters
may be specified.
Creates new instance of options for Cluster#analytics_query
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 |
# File 'lib/couchbase/options.rb', line 1203 def initialize(client_context_id: nil, scan_consistency: nil, readonly: false, priority: nil, transcoder: JsonTranscoder.new, positional_parameters: nil, named_parameters: nil, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) raise ArgumentError, "Cannot pass positional and named parameters at the same time" if positional_parameters && named_parameters super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span) @client_context_id = client_context_id @scan_consistency = scan_consistency @readonly = readonly @priority = priority @transcoder = transcoder @positional_parameters = positional_parameters @named_parameters = named_parameters @raw_parameters = {} yield self if block_given? end |
Instance Attribute Details
#client_context_id ⇒ String
1164 1165 1166 |
# File 'lib/couchbase/options.rb', line 1164 def client_context_id @client_context_id end |
#priority ⇒ Boolean
1167 1168 1169 |
# File 'lib/couchbase/options.rb', line 1167 def priority @priority end |
#readonly ⇒ Boolean
1166 1167 1168 |
# File 'lib/couchbase/options.rb', line 1166 def readonly @readonly end |
#scan_consistency ⇒ Symbol
1165 1166 1167 |
# File 'lib/couchbase/options.rb', line 1165 def scan_consistency @scan_consistency end |
#transcoder ⇒ JsonTranscoder, #decode(String)
1168 1169 1170 |
# File 'lib/couchbase/options.rb', line 1168 def transcoder @transcoder end |
Instance Method Details
#named_parameters(named) ⇒ Object
Sets named parameters for the query
1239 1240 1241 1242 |
# File 'lib/couchbase/options.rb', line 1239 def named_parameters(named) @named_parameters = named @positional_parameters = nil end |
#positional_parameters(positional) ⇒ Object
Sets positional parameters for the query
1231 1232 1233 1234 |
# File 'lib/couchbase/options.rb', line 1231 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
1248 1249 1250 |
# File 'lib/couchbase/options.rb', line 1248 def raw(key, value) @raw_parameters[key] = JSON.generate(value) end |