Module: CaTissue::Resource
- Includes:
- CaRuby::AttributeInitializer, CaRuby::IdAlias, CaRuby::Resource, Annotatable
- Included in:
- AbstractDomainObject, AbstractSpecimen, AbstractSpecimenCollectionGroup, Address, CancerResearchGroup, Capacity, CheckInCheckOutEventParameter, CollectionEventParameters, CollectionProtocol, CollectionProtocolEvent, CollectionProtocolRegistration, ConsentTierResponse, ConsentTierStatus, Container, ContainerPosition, ContainerType, Department, DisposalEventParameters, EmbeddedEventParameters, ExternalIdentifier, FrozenEventParameters, Institution, NewSpecimenArrayOrderItem, OrderDetails, Participant, ParticipantMedicalIdentifier, Password, Race, ReceivedEventParameters, Site, Specimen, SpecimenArray, SpecimenArrayContent, SpecimenArrayType, SpecimenCharacteristics, SpecimenCollectionGroup, SpecimenEventParameters, SpecimenPosition, SpecimenProtocol, SpecimenRequirement, StorageContainer, StorageType, TransferEventParameters, User
- Defined in:
- lib/catissue/resource.rb
Overview
The module included by all CaTissue domain classes.
Class Method Summary collapse
-
.included(klass) ⇒ Object
Adds the given domain class to the CaTissue domain module.
Instance Method Summary collapse
-
#database ⇒ Object
Returns the CaTissue::Database which stores this object.
-
#tolerant_match?(other, attributes) ⇒ Boolean
Returns whether each of the given attribute values either equals the respective other attribute value or one of the values is nil or ‘Not Specified’.
Methods included from Annotatable
#annotation_proxy, #create_proxy, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CaTissue::Annotatable
Class Method Details
.included(klass) ⇒ Object
Adds the given domain class to the CaTissue domain module.
16 17 18 19 20 21 22 23 24 |
# File 'lib/catissue/resource.rb', line 16 def self.included(klass) super CaTissue.add_class(klass) # defer loading AnnotatableClass to avoid pulling in Database, which in turn # attempts to import java classes before the path is established. obscure # detail, but don't know how to avoid it. require 'catissue/annotation/annotatable_class' klass.extend(AnnotatableClass) end |
Instance Method Details
#database ⇒ Object
Returns the CaTissue::Database which stores this object.
38 39 40 |
# File 'lib/catissue/resource.rb', line 38 def database CaTissue::Database.instance end |
#tolerant_match?(other, attributes) ⇒ Boolean
Returns whether each of the given attribute values either equals the respective other attribute value or one of the values is nil or ‘Not Specified’.
33 34 35 |
# File 'lib/catissue/resource.rb', line 33 def tolerant_match?(other, attributes) attributes.all? { |attr| Resource.tolerant_value_match?(send(attr), other.send(attr)) } end |