Module: JobNotifier::Identifier

Extended by:
ActiveSupport::Concern
Defined in:
lib/job_notifier/identifier.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#identifier_from_attrsObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/job_notifier/identifier.rb', line 17

def identifier_from_attrs
  keys = self.class.identifier_attrs
  raise JobNotifier::Error::MissingAttributes.new if keys.blank?

  keys.sort.map do |attribute|
    value = send(attribute)
    raise JobNotifier::Error::BlankAttribute.new(attribute) if value.blank?
    [attribute, value.to_s]
  end.flatten.join("::")
end