Class: Booth::Userland::Remotes::Update

Inherits:
Object
  • Object
show all
Includes:
Concerns::Action
Defined in:
lib/booth/userland/remotes/update.rb

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
# File 'lib/booth/userland/remotes/update.rb', line 9

def call
  request.must_be_patch!

  do_check_logged_in
    .on_success { do_respond }
end

#do_check_logged_inObject



16
17
18
19
20
# File 'lib/booth/userland/remotes/update.rb', line 16

def do_check_logged_in
  return Tron.success :logged_in if credential

  Tron.failure :not_logged_in
end

#do_respondObject



22
23
24
# File 'lib/booth/userland/remotes/update.rb', line 22

def do_respond
  ::Booth::Core::Remotes::Respond.call(scope:, remote: credential.remote, request:)
end