aboutsummaryrefslogtreecommitdiff
path: root/docs/collections_doc.md
blob: 64ffb5e008790b0849560122c8d81389f29b05d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
## collections.after_each

<pre>
collections.after_each(<a href="#collections.after_each-separator">separator</a>, <a href="#collections.after_each-iterable">iterable</a>)
</pre>

Inserts `separator` after each item in `iterable`.

### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="collections.after_each-separator">
      <td><code>separator</code></td>
      <td>
        required.
        <p>
          The value to insert after each item in `iterable`.
        </p>
      </td>
    </tr>
    <tr id="collections.after_each-iterable">
      <td><code>iterable</code></td>
      <td>
        required.
        <p>
          The list into which to intersperse the separator.
        </p>
      </td>
    </tr>
  </tbody>
</table>


## collections.before_each

<pre>
collections.before_each(<a href="#collections.before_each-separator">separator</a>, <a href="#collections.before_each-iterable">iterable</a>)
</pre>

Inserts `separator` before each item in `iterable`.

### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="collections.before_each-separator">
      <td><code>separator</code></td>
      <td>
        required.
        <p>
          The value to insert before each item in `iterable`.
        </p>
      </td>
    </tr>
    <tr id="collections.before_each-iterable">
      <td><code>iterable</code></td>
      <td>
        required.
        <p>
          The list into which to intersperse the separator.
        </p>
      </td>
    </tr>
  </tbody>
</table>


## collections.uniq

<pre>
collections.uniq(<a href="#collections.uniq-iterable">iterable</a>)
</pre>

Returns a list of unique elements in `iterable`.

Requires all the elements to be hashable.


### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="collections.uniq-iterable">
      <td><code>iterable</code></td>
      <td>
        required.
        <p>
          An iterable to filter.
        </p>
      </td>
    </tr>
  </tbody>
</table>