Sha256: bb795d32c073ea57822278d47c2b280f4265d491cec027d6b181175248013b25

Contents?: true

Size: 431 Bytes

Versions: 10

Compression:

Stored size: 431 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.join("public/#{path}").to_s : "/#{path}"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
maglevcms-1.8.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.7.3 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.7.2 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.7.1 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.7.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.6.1 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.6.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.5.1 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.4.0 app/services/maglev/fetch_section_screenshot_path.rb
maglevcms-1.3.0 app/services/maglev/fetch_section_screenshot_path.rb