Files
adamantium/app/commands/workouts/create.rb
2023-04-25 15:56:41 +10:00

20 lines
391 B
Ruby

require "securerandom"
require "dry/monads"
require "filemagic"
module Adamantium
module Commands
module Workouts
class Create < Command
include Deps["repos.workout_repo"]
include Dry::Monads[:result]
def call(svg:, distance:)
workout_repo.create(path: svg, distance: distance, published_at: Time.now)
end
end
end
end
end