Class: Hecks::Application::Commands::Update
- Inherits:
-
Object
- Object
- Hecks::Application::Commands::Update
- Defined in:
- lib/commands/update.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#id ⇒ Object
Returns the value of attribute id.
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args: nil, repository: Repository, domain_module:) ⇒ Update
constructor
A new instance of Update.
- #name ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(args: nil, repository: Repository, domain_module:) ⇒ Update
Returns a new instance of Update.
8 9 10 11 12 13 |
# File 'lib/commands/update.rb', line 8 def initialize(args: nil, repository: Repository, domain_module:) @repository = repository @args = args @errors = [] @id = @args.delete(:id) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
6 7 8 |
# File 'lib/commands/update.rb', line 6 def args @args end |
#errors ⇒ Object
Returns the value of attribute errors.
6 7 8 |
# File 'lib/commands/update.rb', line 6 def errors @errors end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/commands/update.rb', line 6 def id @id end |
#repository ⇒ Object
Returns the value of attribute repository.
6 7 8 |
# File 'lib/commands/update.rb', line 6 def repository @repository end |
Instance Method Details
#call ⇒ Object
19 20 21 22 |
# File 'lib/commands/update.rb', line 19 def call update self end |
#name ⇒ Object
15 16 17 |
# File 'lib/commands/update.rb', line 15 def name self.class.to_s.split('::').last.underscore end |
#to_h ⇒ Object
24 25 26 |
# File 'lib/commands/update.rb', line 24 def to_h { id: id, args: args } end |