1 00:00:00,630 --> 00:00:07,770 Hello and welcome to this lecture in this lecture or we are going to practice many plate in parades 2 00:00:07,860 --> 00:00:10,420 using different methods. 3 00:00:10,830 --> 00:00:15,900 So I'm using the interactive ruby which is the screen here. 4 00:00:15,910 --> 00:00:20,320 If you are on a Windows machine you can access a hi all programs. 5 00:00:20,320 --> 00:00:21,930 Good to Ruby. 6 00:00:22,170 --> 00:00:30,360 And you just click on the icon if you are on a Mac go to a terminal type in RB or if you are on Linux 7 00:00:30,750 --> 00:00:35,590 you can also type in ah being in your shell and that you give me access. 8 00:00:35,600 --> 00:00:39,410 I'm going to start by creating a new Harry. 9 00:00:39,760 --> 00:00:45,290 I'm going to call these fruits when I type in fruits. 10 00:00:45,300 --> 00:00:48,060 This will be the name of Marie. 11 00:00:48,330 --> 00:00:54,830 I'm going to see cause to assign a value and then I include the array symbol. 12 00:00:54,840 --> 00:01:00,160 So the first object in that hour is going to be an apple. 13 00:01:00,290 --> 00:01:05,310 See Paul's comma menkes objet. 14 00:01:05,320 --> 00:01:08,610 I'm going to say horyn. 15 00:01:13,180 --> 00:01:14,200 Makes. 16 00:01:14,330 --> 00:01:16,040 B. 17 00:01:16,320 --> 00:01:18,060 MARY. 18 00:01:19,600 --> 00:01:31,510 I'm going to do one more make beef strawberry straw. 19 00:01:32,710 --> 00:01:37,010 Then close the oury press enter. 20 00:01:37,090 --> 00:01:44,950 So has now created these arrays for me if I want to list the arie's to put the Puts followed by the 21 00:01:44,950 --> 00:01:52,140 name of the erry each would give me a list so listed all members of the array. 22 00:01:52,510 --> 00:01:59,260 If I wanted to paint that it had to be a tree. 23 00:01:59,560 --> 00:02:02,370 I can do that in two ways. 24 00:02:02,410 --> 00:02:12,790 First for reference the arid vides name Corda area by name and into a space and then double less than 25 00:02:12,790 --> 00:02:15,420 sign followed by the name. 26 00:02:15,420 --> 00:02:16,810 I need a new name. 27 00:02:16,810 --> 00:02:25,630 I want to keep the Harry object so I want to add grapes to the list size of type in grapes 28 00:02:28,180 --> 00:02:32,550 and press enter and that should add grapes to the list. 29 00:02:32,560 --> 00:02:40,190 If I do a put on that again puts a by the name of B. 30 00:02:40,200 --> 00:02:42,350 Harry is his seed grapes list. 31 00:02:42,370 --> 00:02:44,250 So you've got grapes listed. 32 00:02:44,320 --> 00:02:50,020 Another way you can get pain to the area is by he push metate. 33 00:02:50,080 --> 00:02:59,770 So if I want to add something else I'll call the tree by name I'll say fruits dont push followed by 34 00:02:59,770 --> 00:03:02,380 the name of the new fruit. 35 00:03:02,690 --> 00:03:04,260 Say plan. 36 00:03:04,780 --> 00:03:05,700 Press Enter. 37 00:03:05,770 --> 00:03:15,170 So now I did look at the area structure he's added plumb to the area as well to view this troxell of 38 00:03:15,190 --> 00:03:15,790 dairy. 39 00:03:15,790 --> 00:03:17,810 Just call the area my name. 40 00:03:17,830 --> 00:03:19,050 Do fruits. 41 00:03:19,430 --> 00:03:24,040 Don't inspect and that will press centre. 42 00:03:24,040 --> 00:03:25,850 Now give me the structure. 43 00:03:26,080 --> 00:03:30,920 So these are kind of like containers in the arrays it tells me in content 1. 44 00:03:31,110 --> 00:03:37,230 Apples container to origins in three berris and so on. 45 00:03:37,420 --> 00:03:42,470 So this is destruction in where these contain various objects. 46 00:03:42,490 --> 00:03:44,710 Each one represents different objects. 47 00:03:44,920 --> 00:03:50,140 This is 0 1 2 3 4 5. 48 00:03:50,200 --> 00:03:54,460 You can also reverse the objects in the array. 49 00:03:54,490 --> 00:04:00,160 So let me list them out do puts. 50 00:04:00,830 --> 00:04:11,640 So give me a list of the Plus a 5 1 2 reverse the order do fruit's dot reverse. 51 00:04:11,730 --> 00:04:17,440 You can see is give is reversed Grape's was the lancer's Giving me grapes first. 52 00:04:17,570 --> 00:04:25,070 I can see how Paul was the first here in the list here Paul is that last plan was the last second first. 53 00:04:25,330 --> 00:04:31,000 So if you want to reverse he just use reverse and that will reverse the all. 54 00:04:31,180 --> 00:04:38,760 You can also add a raise to each other so a raise can contain either a raise or you can join them together. 55 00:04:38,980 --> 00:04:43,660 So let's create a new Harry I am going to create a new record. 56 00:04:43,870 --> 00:04:48,450 There to wall veggie tables. 57 00:04:48,460 --> 00:05:02,120 I am going to set that to hurry and the first member would be broccoli on say procope. 58 00:05:02,720 --> 00:05:08,970 Brock will be my first fruit out on a lot of fruit. 59 00:05:08,990 --> 00:05:12,740 I had a cabbage this time. 60 00:05:13,330 --> 00:05:18,620 I just make it to 4 for now but feel free to add my IF wish I press centre. 61 00:05:18,760 --> 00:05:21,130 Now got another Harry. 62 00:05:21,220 --> 00:05:23,060 Just two objects. 63 00:05:23,210 --> 00:05:26,500 If I want to call that area just call it by its name. 64 00:05:26,530 --> 00:05:27,200 Puts. 65 00:05:27,250 --> 00:05:31,440 Followed by fakie table. 66 00:05:32,390 --> 00:05:34,110 And that will give me a list. 67 00:05:34,380 --> 00:05:47,590 So if I want to merge the two trees together are just typing fruit's Plus there are two balls and press 68 00:05:47,650 --> 00:05:54,730 pointer as you can see if had the two arrays together and you can see it gives me a list of all the 69 00:05:54,730 --> 00:06:02,310 objects in five different areas first and then goes on to the ones from the vegetable. 70 00:06:02,320 --> 00:06:04,990 So you gone broccoli you've got cabbage. 71 00:06:05,320 --> 00:06:09,070 So that's how you manage plate harrie's. 72 00:06:09,190 --> 00:06:12,450 Please feel free to experiment a bit further and. 73 00:06:12,630 --> 00:06:16,010 So you get acquainted to how it works. 74 00:06:16,010 --> 00:06:25,140 You can also reference the ruby documentation on more methods of how to manage police parade. 75 00:06:25,280 --> 00:06:27,590 This is just a basic introduction. 76 00:06:27,620 --> 00:06:31,910 This much more you can do with Harris many thanks for watching. 77 00:06:32,000 --> 00:06:33,160 And bye for now.