Class: Hecks::Application::Commands::Delete
- Inherits:
-
Object
- Object
- Hecks::Application::Commands::Delete
- Defined in:
- lib/commands/delete.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args: nil, repository:, domain_module:) ⇒ Delete
constructor
A new instance of Delete.
- #name ⇒ Object
- #to_h ⇒ Object
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
#args ⇒ Object
Returns the value of attribute args.
6 7 8 |
# File 'lib/commands/delete.rb', line 6 def args @args end |
#errors ⇒ Object
Returns the value of attribute errors.
6 7 8 |
# File 'lib/commands/delete.rb', line 6 def errors @errors end |
Instance Method Details
#call ⇒ Object
14 15 16 17 |
# File 'lib/commands/delete.rb', line 14 def call delete self end |
#name ⇒ Object
19 20 21 |
# File 'lib/commands/delete.rb', line 19 def name self.class.to_s.split('::').last.underscore end |
#to_h ⇒ Object
23 24 25 |
# File 'lib/commands/delete.rb', line 23 def to_h { errors: errors, args: args } end |