# Dry-initializer type constraint

**URL:** <https://discourse.dry-rb.org/t/dry-initializer-type-constraint/618>\
**Category:** Support\
**Created:** [August 27, 2018, 8:00pm UTC](https://discourse.dry-rb.org/t/dry-initializer-type-constraint/618 "2018-08-27T20:00:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaricpittman](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/aaricpittman/32/266_2.png) [@aaricpittman](https://discourse.dry-rb.org/u/aaricpittman)\
**Post date:** [August 27, 2018, 8:00pm UTC](https://discourse.dry-rb.org/t/dry-initializer-type-constraint/618/1 "2018-08-27T20:00:10Z")

</div>

I’m trying out dry-initializer and I want to add a type constraint to one of my options that says that the option inherits from a parent class. How would I go about this?

---

<div class="post-metadata">

**Author:** ![aaricpittman](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/aaricpittman/32/266_2.png) [@aaricpittman](https://discourse.dry-rb.org/u/aaricpittman)\
**Post date:** [August 27, 2018, 8:18pm UTC](https://discourse.dry-rb.org/t/dry-initializer-type-constraint/618/2 "2018-08-27T20:18:23Z")

</div>

I did a little more experimenting and realized the option I’m trying to constrain is getting a class. So, a type constraint is not exactly what I want. What I want is an ancestor constraint. I’m expecting it to be something that subclasses Dry::System::Container. Is there a way to do this with dry-initializer and dry-types?
