-
Notifications
You must be signed in to change notification settings - Fork 0
/
w2_notes.rb
40 lines (22 loc) · 898 Bytes
/
w2_notes.rb
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
# Testing types
# -Unit
# -Integration
# -Acceptamce
# -...and more
# ==============================================
# ==============================================
# $UNDERSCORE
# if we have this array with 3 values
@array = ["Pepe", 21, "[email protected]", "@twitter"]
# and the program use a method where we only need two for example said
#the name and the twitter account, we can do something like this:
def calling_user_and_twitter_only(name,twitter)
@array.select {|name,_,_,twitter|} #...whatever
end
# The underscore means: OK here should be something, but we don't need this value right now.
# ==============================================
# ==============================================
# $UPCASE
# If you create a Hash or Array named in UPCASE you are declaring that the Hash created is a constant
# the values inside never change.
ARRAY = [1,2,3,67]