chroma-db 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/notebook/ruby.txt DELETED
@@ -1,58 +0,0 @@
1
- Array#any?
2
-
3
- any? → true or false
4
- any? {|element| ... } → true or false
5
- any?(obj) → true or false
6
-
7
- Returns true if any element of self meets a given criterion.
8
-
9
- With no block given and no argument, returns true if self has any truthy element, false otherwise:
10
-
11
- [nil, 0, false].any? # => true
12
- [nil, false].any? # => false
13
- [].any? # => false
14
- With a block given and no argument, calls the block with each element in self; returns true if the block returns any truthy value, false otherwise:
15
-
16
- [0, 1, 2].any? {|element| element > 1 } # => true
17
- [0, 1, 2].any? {|element| element > 2 } # => false
18
- If argument obj is given, returns true if obj.=== any element, false otherwise:
19
-
20
- ['food', 'drink'].any?(/foo/) # => true
21
- ['food', 'drink'].any?(/bar/) # => false
22
- [].any?(/foo/) # => false
23
- [0, 1, 2].any?(1) # => true
24
- [0, 1, 2].any?(3) # => false
25
- Related: Enumerable#any?
26
-
27
-
28
- Array#map Array#map!
29
-
30
- map {|element| ... } → new_array
31
- map → new_enumerator
32
- Calls the block, if given, with each element of self; returns a new Array whose elements are the return values from the block:
33
-
34
- a = [:foo, 'bar', 2]
35
- a1 = a.map {|element| element.class }
36
- a1 # => [Symbol, String, Integer]
37
- Returns a new Enumerator if no block given:
38
-
39
- a = [:foo, 'bar', 2]
40
- a1 = a.map
41
- a1 # => #<Enumerator: [:foo, "bar", 2]:map>
42
- Array#collect is an alias for Array#map.
43
-
44
- Alias for: collect
45
- map! {|element| ... } → self
46
- map! → new_enumerator
47
- Calls the block, if given, with each element; replaces the element with the block’s return value:
48
-
49
- a = [:foo, 'bar', 2]
50
- a.map! { |element| element.class } # => [Symbol, String, Integer]
51
- Returns a new Enumerator if no block given:
52
-
53
- a = [:foo, 'bar', 2]
54
- a1 = a.map!
55
- a1 # => #<Enumerator: [:foo, "bar", 2]:map!>
56
- Array#collect! is an alias for Array#map!.
57
-
58
- Alias for: collect!