- Included in:
- , ,
- Defined in:
Used by certain types to create subtypes of those types. This is useful in collections and hashes, wherein the collection members and hash keys/values all have types as well (and need to be coerced to them).
Instance Method Summary collapse
#(*subs) ⇒ Class
Creates a subtype with the given member types.
Instance Method Details
Creates a subtype with the given member types. Any number of subtypes may be used. If a class hasn't been created with the subtypes, it creates a new one.
17 18 19 20 21 22
# File 'lib/mixture/types/access.rb', line 17 def (*subs) inferred = infer_subs(subs) [:types].fetch([self, inferred]) do create(inferred) end end