Class: CMIS::Server
- Inherits:
-
Connection
- Object
- Connection
- CMIS::Server
- Defined in:
- lib/cmis/server.rb
Instance Method Summary collapse
- #execute!(params = {}, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Server
constructor
A new instance of Server.
- #repositories(opts = {}) ⇒ Object
- #repository(repository_id, opts = {}) ⇒ Object
- #repository?(repository_id) ⇒ Boolean
Methods inherited from Connection
Constructor Details
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
3 4 5 |
# File 'lib/cmis/server.rb', line 3 def initialize( = {}) = .symbolize_keys end |
Instance Method Details
#execute!(params = {}, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/cmis/server.rb', line 7 def execute!(params = {}, = {}) params.symbolize_keys! .symbolize_keys! query = .fetch(:query, {}) headers = .fetch(:headers, {}) response = connection.do_request(params, query, headers) response.body end |
#repositories(opts = {}) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/cmis/server.rb', line 18 def repositories(opts = {}) result = execute!({}, opts) result.values.map do |r| Repository.new(r, self) end end |
#repository(repository_id, opts = {}) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/cmis/server.rb', line 26 def repository(repository_id, opts = {}) result = execute!({ cmisselector: 'repositoryInfo', repositoryId: repository_id }, opts) Repository.new(result[repository_id], self) end |
#repository?(repository_id) ⇒ Boolean
33 34 35 36 37 38 |
# File 'lib/cmis/server.rb', line 33 def repository?(repository_id) repository(repository_id) true rescue Exceptions::ObjectNotFound false end |