Class: CMIS::Relationship

Inherits:
Object
  • Object
show all
Defined in:
lib/cmis/relationship.rb

Instance Attribute Summary

Attributes inherited from Object

#properties, #repository

Instance Method Summary collapse

Methods inherited from Object

#acls, #add_aces, #allowable_actions, #delete, #delete_with_relationships, #detached?, #inspect, #move, #object_type, #parents, #policies, #refresh, #relationships, #remove_aces, #unfile, #update_properties

Methods included from Helpers

#cmis_properties, #initialize_properties, #method_missing, #respond_to?, #with_change_token

Constructor Details

#initialize(raw, repository) ⇒ Relationship


3
4
5
6
# File 'lib/cmis/relationship.rb', line 3

def initialize(raw, repository)
  super
  cmis_properties %w( cmis:sourceId cmis:targetId )
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CMIS::Helpers

Instance Method Details

#create(opts = {}) ⇒ Object


16
17
18
# File 'lib/cmis/relationship.rb', line 16

def create(opts = {})
  repository.create_relationship(self, opts)
end

#source(opts = {}) ⇒ Object


8
9
10
# File 'lib/cmis/relationship.rb', line 8

def source(opts = {})
  repository.object(source_id, opts)
end

#target(opts = {}) ⇒ Object


12
13
14
# File 'lib/cmis/relationship.rb', line 12

def target(opts = {})
  repository.object(target_id, opts)
end