File: array-with-member.html.md

package info (click to toggle)
ruby-dry-types 1.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 504 kB
  • sloc: ruby: 3,059; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 246 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
---
title: Array With Member
layout: gem-single
name: dry-types
---

The built-in array type supports defining the member's type:

``` ruby
PostStatuses = Types::Array.of(Types::Coercible::String)

PostStatuses[[:foo, :bar]] # ["foo", "bar"]
```