Class: Hexagonal::Runners::DeleteRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/hexagonal/runners/delete_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#policy=(value) ⇒ Object (writeonly)

Sets the attribute policy

Parameters:

  • value

    the value to set the attribute policy to.



8
9
10
# File 'lib/hexagonal/runners/delete_runner.rb', line 8

def policy=(value)
  @policy = value
end

#repository=(value) ⇒ Object (writeonly)

Sets the attribute repository

Parameters:

  • value

    the value to set the attribute repository to.



8
9
10
# File 'lib/hexagonal/runners/delete_runner.rb', line 8

def repository=(value)
  @repository = value
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
# File 'lib/hexagonal/runners/delete_runner.rb', line 10

def run
  authorize!
  delete!
  deleted_successfully target
rescue Hexagonal::Errors::UnauthorizedException => ex
  unauthorized(ex)
end