Module: CaTissue::Annotation::Proxy

Includes:
JSON
Included in:
Proxy_1_1, RecordEntryProxy
Defined in:
lib/catissue/annotation/proxy.rb

Overview

Resource annotation hook proxy mix-in.

Instance Method Summary collapse

Instance Method Details

#ensure_hook_existsObject

Ensures that this proxy’s hook exists in the database.



20
21
22
23
# File 'lib/catissue/annotation/proxy.rb', line 20

def ensure_hook_exists
  if hook.nil? then raise AnnotationError.new("Annotation proxy #{self} is missing the hook domain object") end
  hook.ensure_exists
end

#hookAnnotatable

Returns the annotated domain object.

Returns:



10
11
12
# File 'lib/catissue/annotation/proxy.rb', line 10

def hook
  send(self.class.owner_property.reader)
end

#hook=(obj) ⇒ Object

Parameters:



15
16
17
# File 'lib/catissue/annotation/proxy.rb', line 15

def hook=(obj)
  send(self.class.owner_property.writer, obj)
end