lib/catissue/helpers/collectible.rb
def extract_event_parameters(opts)
      # Check if there is an attribute association
      eps = opts.delete(:specimen_event_parameters) || []
      # collect additional parameter associations
      rcvr = opts.delete(:receiver)
      cltr = opts.delete(:collector) || rcvr
      # if there is not at least a collector, then don't continue parsing
      return eps if cltr.nil?
      rdate = opts.delete(:received_date)
      rdate ||= DateTime.now
      eps << CaTissue::SpecimenEventParameters.create_parameters(:received, self, :user => rcvr, :timestamp => rdate)
      cdate = opts.delete(:collected_date)
      cdate ||= rdate
      eps << CaTissue::SpecimenEventParameters.create_parameters(:collection, self, :user => cltr, :timestamp => cdate)
      logger.debug { "Collectible #{self} event parameters: #{eps.pp_s(:single_line)}" }
      eps
    end
def extract_event_parameters(opts)
      # Check if there is an attribute association
      eps = opts.delete(:specimen_event_parameters) || []
      # collect additional parameter associations
      rcvr = opts.delete(:receiver)
      cltr = opts.delete(:collector) || rcvr
      # if there is not at least a collector, then don't continue parsing
      return eps if cltr.nil?
      rdate = opts.delete(:received_date)
      rdate ||= DateTime.now
      eps << CaTissue::SpecimenEventParameters.create_parameters(:received, self, :user => rcvr, :timestamp => rdate)
      cdate = opts.delete(:collected_date)
      cdate ||= rdate
      eps << CaTissue::SpecimenEventParameters.create_parameters(:collection, self, :user => cltr, :timestamp => cdate)
      logger.debug { "Collectible #{self} event parameters: #{eps.pp_s(:single_line)}" }
      eps
    end
def extract_event_parameters ( opts ) # Check if there is an attribute association eps = opts . delete ( :specimen_event_parameters ) || [ ] # collect additional parameter associations rcvr = opts . delete ( :receiver ) cltr = opts . delete ( :collector ) || rcvr # if there is not at least a collector, then don't continue parsing return eps if cltr . nil? rdate = opts . delete ( :received_date ) rdate ||= DateTime . now eps << CaTissue :: SpecimenEventParameters . create_parameters ( :received , self , :user => rcvr , :timestamp => rdate ) cdate = opts . delete ( :collected_date ) cdate ||= rdate eps << CaTissue :: SpecimenEventParameters . create_parameters ( :collection , self , :user => cltr , :timestamp => cdate ) logger . debug { "Collectible #{self} event parameters: #{eps.pp_s(:single_line)}" } eps end
Extracts #{CaTissue::CollectibleEventParameters} from the given options.
 The options are removed from the *opts* paramater.

 @param [{Symbol => Object}] opts the merge options
 @option opts [Enumerable] :specimen_event_parameters the optional SEP merge collection to augment
 @option opts [CaTissue::User] :receiver the tissue bank user who received the tissue
 @option opts [Date] :received_date the received date (defaults to now)
 @option opts [CaTissue::User] :collector the user who acquired the tissue
   (defaults to the receiver)
 @option opts [Date] :collected_date the collection date (defaults to the received date)
 @return [CaTissue::SpecimenEventParameters] the augmented SEPS
Extracts # { CaTissue :: CollectibleEventParameters } from the given options . The options are removed from the * opts * paramater .