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
-
#ensure_hook_exists ⇒ Object
Ensures that this proxy’s hook exists in the database.
-
#hook ⇒ Annotatable
The annotated domain object.
- #hook=(obj) ⇒ Object
Instance Method Details
#ensure_hook_exists ⇒ Object
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 |
#hook ⇒ Annotatable
Returns the annotated domain object.
10 11 12 |
# File 'lib/catissue/annotation/proxy.rb', line 10 def hook send(self.class.owner_property.reader) end |
#hook=(obj) ⇒ Object
15 16 17 |
# File 'lib/catissue/annotation/proxy.rb', line 15 def hook=(obj) send(self.class.owner_property.writer, obj) end |