Module: CaTissue::Annotation
- Includes:
- CaRuby::IdAlias, CaRuby::Resource
- Defined in:
- lib/catissue/annotation/annotation.rb,
lib/catissue/annotation/proxy.rb,
lib/catissue/annotation/proxy_class.rb,
lib/catissue/database/annotation/id_generator.rb,
lib/catissue/database/annotation/entity_facade.rb,
lib/catissue/database/annotation/reference_writer.rb,
lib/catissue/database/annotation/annotation_service.rb,
lib/catissue/database/annotation/integration_service.rb
Overview
Annotation class mix-in.
Defined Under Namespace
Modules: Proxy, ProxyClass Classes: AnnotationService, EntityFacade, IdGenerator, IntegrationService, ReferenceWriter
Instance Method Summary collapse
-
#database ⇒ Object
Returns the CaTissue::Database which stores this object.
-
#ensure_proxy_reflects_hook ⇒ Object
Updates the annotation proxy to reflect the hook, if necessary.
-
#hook ⇒ Annotatable
The hook object which owns this annotation, or nil if this annotation is not directly owned by a hook entity.
-
#owner ⇒ Object
If there is no conventional owner, then try the hook.
-
#proxy ⇒ Proxy
The proxy which references this annotation.
Instance Method Details
#database ⇒ Object
Returns the CaTissue::Database which stores this object.
13 14 15 |
# File 'lib/catissue/annotation/annotation.rb', line 13 def database CaTissue::Database.instance end |
#ensure_proxy_reflects_hook ⇒ Object
Updates the annotation proxy to reflect the hook, if necessary.
20 21 22 23 |
# File 'lib/catissue/annotation/annotation.rb', line 20 def ensure_proxy_reflects_hook pxy = proxy || return pxy.ensure_identifier_reflects_hook end |
#hook ⇒ Annotatable
Returns the hook object which owns this annotation, or nil if this annotation is not directly owned by a hook entity.
27 28 29 30 |
# File 'lib/catissue/annotation/annotation.rb', line 27 def hook pxy_attr = self.class.proxy_attribute send(pxy_attr) if pxy_attr end |
#owner ⇒ Object
If there is no conventional owner, then try the hook.
35 36 37 |
# File 'lib/catissue/annotation/annotation.rb', line 35 def owner super or hook end |
#proxy ⇒ Proxy
Returns the proxy which references this annotation.
40 41 42 43 44 45 46 47 |
# File 'lib/catissue/annotation/annotation.rb', line 40 def proxy # the annotation owner hook instance ownr = hook || return # the hook -> annotation reference attribute attr = self.class.hook_proxy_attribute # the owner proxy for the attribute ownr.annotation_proxy(attr) end |