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
- #scope_qualifier ⇒ String
- #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, scope_qualifier: 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, scope_qualifier: 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
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 |
# File 'lib/couchbase/options.rb', line 1208 def initialize(client_context_id: nil, scan_consistency: nil, readonly: false, priority: nil, transcoder: JsonTranscoder.new, positional_parameters: nil, named_parameters: nil, scope_qualifier: 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 @scope_qualifier = scope_qualifier @raw_parameters = {} yield self if block_given? end |
Instance Attribute Details
#client_context_id ⇒ String
1166 1167 1168 |
# File 'lib/couchbase/options.rb', line 1166 def client_context_id @client_context_id end |
#priority ⇒ Boolean
1169 1170 1171 |
# File 'lib/couchbase/options.rb', line 1169 def priority @priority end |
#readonly ⇒ Boolean
1168 1169 1170 |
# File 'lib/couchbase/options.rb', line 1168 def readonly @readonly end |
#scan_consistency ⇒ Symbol
1167 1168 1169 |
# File 'lib/couchbase/options.rb', line 1167 def scan_consistency @scan_consistency end |
#scope_qualifier ⇒ String
1171 1172 1173 |
# File 'lib/couchbase/options.rb', line 1171 def scope_qualifier @scope_qualifier end |
#transcoder ⇒ JsonTranscoder, #decode(String)
1170 1171 1172 |
# File 'lib/couchbase/options.rb', line 1170 def transcoder @transcoder end |
Instance Method Details
#named_parameters(named) ⇒ Object
Sets named parameters for the query
1246 1247 1248 1249 |
# File 'lib/couchbase/options.rb', line 1246 def named_parameters(named) @named_parameters = named @positional_parameters = nil end |
#positional_parameters(positional) ⇒ Object
Sets positional parameters for the query
1238 1239 1240 1241 |
# File 'lib/couchbase/options.rb', line 1238 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
1255 1256 1257 |
# File 'lib/couchbase/options.rb', line 1255 def raw(key, value) @raw_parameters[key] = JSON.generate(value) end |