You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
450 B
32 lines
450 B
class Gitea::RegisterInteractor
|
|
def self.call(params)
|
|
interactor = new(params)
|
|
interactor.run
|
|
interactor
|
|
end
|
|
|
|
attr_reader :error
|
|
|
|
def initialize(params)
|
|
@params = params
|
|
end
|
|
|
|
def success?
|
|
@error.nil?
|
|
end
|
|
|
|
def run
|
|
Gitea::Users::RegisterService.new(params).call
|
|
rescue Exception => exception
|
|
fail!(exception.message)
|
|
end
|
|
|
|
private
|
|
|
|
attr_reader :params
|
|
|
|
def fail!(error)
|
|
@error = error
|
|
end
|
|
end
|