# app/services/blueprints/build_service.rb # frozen_string_literal: true module Blueprints class BuildService < Blueprints::BaseService prepend ValidatesRemoteObject def execute validate! Blueprint.new.tap do |b| b.url = remote_object.public_url b.url_path = remote_object.key b.size = remote_object.size b.content_type = remote_object.content_type b.thumb_url = '' end end private def validate! raise ValidationError, 'File not found' unless remote_object_exists? end def bucket ObjectStorage::DirectUpload::Bucket end end end