class WarpEngine::FileResultDto
What WarpEngine::FileService#show decided for a requested path: send a local file, redirect, or report it missing.
Attributes
type is :file, :redirect or :not_found; path is the local file to send (for :file); url is the redirect target (for :redirect).
type is :file, :redirect or :not_found; path is the local file to send (for :file); url is the redirect target (for :redirect).
type is :file, :redirect or :not_found; path is the local file to send (for :file); url is the redirect target (for :redirect).
Public Class Methods
Source
# File app/dtos/warp_engine/file_result_dto.rb, line 19 def self.file(path) = new(type: :file, path: path)
Returns a :file result for the local file at path.
# File app/dtos/warp_engine/file_result_dto.rb, line 12 def initialize(type:, path: nil, url: nil) @type = type @path = path @url = url end
Builds a result of type with an optional path or url. The class methods ::file, ::redirect and ::not_found are the usual way in.
Source
# File app/dtos/warp_engine/file_result_dto.rb, line 23 def self.not_found = new(type: :not_found)
Returns a :not_found result.
Source
# File app/dtos/warp_engine/file_result_dto.rb, line 21 def self.redirect(url) = new(type: :redirect, url: url)
Returns a :redirect result pointing at url.