Class: CMIS::Server
- Inherits:
-
Object
- Object
- CMIS::Server
- Defined in:
- lib/cmis/server.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #has_repository?(repository_id) ⇒ Boolean
-
#initialize(options = {}) ⇒ Server
constructor
A new instance of Server.
- #repositories(opts = {}) ⇒ Object
- #repository(repository_id, opts = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
5 6 7 |
# File 'lib/cmis/server.rb', line 5 def initialize( = {}) @connection = Connection.new() end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/cmis/server.rb', line 3 def connection @connection end |
Instance Method Details
#has_repository?(repository_id) ⇒ Boolean
24 25 26 27 28 29 |
# File 'lib/cmis/server.rb', line 24 def has_repository?(repository_id) repository(repository_id) true rescue Exceptions::ObjectNotFound false end |
#repositories(opts = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/cmis/server.rb', line 9 def repositories(opts = {}) result = connection.execute!({}, opts) result.values.map do |r| Repository.new(r, connection) end end |
#repository(repository_id, opts = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/cmis/server.rb', line 17 def repository(repository_id, opts = {}) result = connection.execute!({ cmisselector: 'repositoryInfo', repositoryId: repository_id }, opts) Repository.new(result[repository_id], connection) end |