Sha256: fc970cce6bdf1ed3f47225658707834d681d443335b1bf8bb4ce05c53ebd4723
Contents?: true
Size: 846 Bytes
Versions: 8
Compression:
Stored size: 846 Bytes
Contents
module Services class ReverseMatchService include Rails.application.routes.url_helpers def initialize(host, protocol) raise ArgumentError if host.blank? raise ArgumentError if protocol.blank? @host = host @protocol = protocol end def build_job(type, concept, subject, match_class) raise ArgumentError if type.empty? || concept.nil? || subject.blank? || match_class.blank? referer = root_url(host: @host, protocol: @protocol) object = rdf_url(concept.origin, host: @host, protocol: @protocol) match_classes = Iqvoc::Concept.reverse_match_class_names match_class = match_classes[match_class] ReverseMatchJob.new(type, concept, match_class, subject, object, referer) end def add(job) Delayed::Job.enqueue(job, queue: 'reverse_matches') end end end
Version data entries
8 entries across 8 versions & 1 rubygems