Class: Hecks::Application::Commands::Delete

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/delete.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args: nil, repository:, domain_module:) ⇒ Delete

Returns a new instance of Delete.



8
9
10
11
12
# File 'lib/commands/delete.rb', line 8

def initialize(args: nil, repository:, domain_module:)
  @args            = args || chained_command.args
  @repository      = repository
  @errors          = { base: [] }
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



6
7
8
# File 'lib/commands/delete.rb', line 6

def args
  @args
end

#errorsObject

Returns the value of attribute errors.



6
7
8
# File 'lib/commands/delete.rb', line 6

def errors
  @errors
end

Instance Method Details

#callObject



14
15
16
17
# File 'lib/commands/delete.rb', line 14

def call
  delete
  self
end

#nameObject



19
20
21
# File 'lib/commands/delete.rb', line 19

def name
  self.class.to_s.split('::').last.underscore
end

#to_hObject



23
24
25
# File 'lib/commands/delete.rb', line 23

def to_h
  { errors: errors, args: args }
end