# Explanation of super in intitialize

**URL:** https://discourse.dry-rb.org/t/explanation-of-super-in-intitialize/764
**Category:** Support
**Created:** [April 29, 2019, 11:11am UTC](https://discourse.dry-rb.org/t/explanation-of-super-in-intitialize/764 "2019-04-29T11:11:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![meicmarko](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@meicmarko](https://discourse.dry-rb.org/u/meicmarko)
#### Post date: [April 29, 2019, 11:11am UTC](https://discourse.dry-rb.org/t/explanation-of-super-in-intitialize/764/1 "2019-04-29T11:11:50Z")

</div>

I started using `dry-auto_inject` gem with **kwargs** strategy, but I am not sure if I understand why `super(**dependencies)` should be in initialize method when including Dry Container in my class.

[https://dry-rb.org/gems/dry-auto\_inject/how-does-it-work/](https://dry-rb.org/gems/dry-auto_inject/how-does-it-work/)

In example below, class MyService is child of `base_service` class.

```
#base_service.rb
class BaseService
  def self.call(*args)
    new(*args).call
  end

  def call
    raise 'Not implemented'
  end
end

#my_service.rb
class MyService < BaseService
include InjectServices['some_service', 'external_service']

  def initialize(fields:, **dependencies)
    @fields = fields
    super(**dependencies)
  end
end

```

Do I need `super(**dependencies)`? I would be grateful if I could get a more detailed explanation.

---

<div class="post-metadata">

### Author: ![timriley](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/timriley/32/25_2.png) [@timriley](https://discourse.dry-rb.org/u/timriley)
#### Post date: [May 1, 2019, 4:11am UTC](https://discourse.dry-rb.org/t/explanation-of-super-in-intitialize/764/2 "2019-05-01T04:11:12Z")

</div>

Yes, if you’re writing your own `#initialize`, you need to pass the `**dependencies` up to the `#initialize` provided by the injector mixin, otherwise it won’t properly receive and assign the auto-injected dependencies that are being passed in from the `.new` method that the injector also provides.
