Class: Couchbase::Protostellar::ResponseConverter::Admin::Collection Private

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/protostellar/response_converter/admin/collection.rb

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

Class Method Summary collapse

Class Method Details

.to_scope_spec_array(resp) ⇒ Object

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.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/couchbase/protostellar/response_converter/admin/collection.rb', line 24

def self.to_scope_spec_array(resp)
  resp.scopes.map do |s|
    Couchbase::Management::ScopeSpec.new do |scope_spec|
      scope_spec.name = s.name
      scope_spec.collections = s.collections.map do |c|
        Couchbase::Management::CollectionSpec.new do |coll_spec|
          coll_spec.name = c.name
          coll_spec.scope_name = s.name
          coll_spec.max_expiry = c.max_expiry_secs if c.has_max_expiry_secs?
        end
      end
    end
  end
end