Sha256: caaa3a54b338c8f0471719e68968b319b8bc6105964c37f199b9307265a3cc35
Contents?: true
Size: 611 Bytes
Versions: 7
Compression:
Stored size: 611 Bytes
Contents
# frozen_string_literal: true require_dependency 'scribo/application_service' module Scribo class SiteFindService < ApplicationService attr_reader :options def initialize(options = {}) super() @options = options end def perform return options[:site] if options[:site].is_a?(Scribo::Site) scribable = Scribo.config.scribable_for_request(options[:request]) return nil unless scribable scope = scribable.sites scope = scope.for_host(options[:host]) scope = scope.for_path(options[:path]) if options[:path] scope.first end end end
Version data entries
7 entries across 7 versions & 1 rubygems