Sha256: f5f27b46b023bea2cf1170ee4a35231ba3fd8004032acfbea966ec3cd09f794e

Contents?: true

Size: 423 Bytes

Versions: 15

Compression:

Stored size: 423 Bytes

Contents

# frozen_string_literal: true

module Maglev
  class FetchSectionScreenshotPath
    include Injectable

    dependency :fetch_sections_path
    argument :theme, default: nil
    argument :section
    argument :absolute, default: false

    def call
      path = "#{fetch_sections_path.call(theme: theme)}/#{section.category}/#{section.id}.jpg"
      absolute ? "#{Rails.root}/public/#{path}" : "/#{path}"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
maglevcms-1.2.2 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.2.1 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.2.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.7 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.6 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.5 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.4 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.3 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.2 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.1 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.1.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.0.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.0.0.rc3 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.0.0.rc2 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.0.0.rc1 app/services/maglev/fetch_section_screenshot_path.rb