1 00:00:05,230 --> 00:00:10,780 Ruby Core contains the classes and modules that come with Ruby and make Ruby work. 2 00:00:10,780 --> 00:00:15,430 For example, Ruby Core contains many familiar classes that you've worked with 3 00:00:15,430 --> 00:00:20,190 so far, things like Array, Hash, Fixnum, and more. 4 00:00:21,440 --> 00:00:26,910 Let's take a look at some of what Ruby Core has to offer now using workspaces. 5 00:00:26,910 --> 00:00:29,820 So here is the Ruby Core documentation. 6 00:00:29,820 --> 00:00:34,310 Now, you'll find a link to this in the notes right below the video. 7 00:00:34,310 --> 00:00:37,270 So, you can go ahead and look that up and follow along. 8 00:00:37,270 --> 00:00:41,430 Now, when we look at the documentation, on the left side here, right on top, 9 00:00:41,430 --> 00:00:45,180 the first thing that we have is a list of files. 10 00:00:45,180 --> 00:00:50,090 This documentation format is relatively standard for Ruby Core, 11 00:00:50,090 --> 00:00:53,200 standard library, and even some gems. 12 00:00:53,200 --> 00:00:54,390 Here we see on the left side, 13 00:00:54,390 --> 00:00:58,860 that is all of the different files that would be in this package. 14 00:00:58,860 --> 00:01:01,010 And right now these are just documentation links. 15 00:01:03,130 --> 00:01:06,250 Here is where documentation gets good. 16 00:01:06,250 --> 00:01:07,350 On the left side, 17 00:01:07,350 --> 00:01:11,010 we have all of the different classes that are part of Ruby Core. 18 00:01:12,020 --> 00:01:16,320 Some of these are going to look very familiar, like Array. 19 00:01:16,320 --> 00:01:21,320 I'm gonna go ahead and click on this here and we can see the Array documentation. 20 00:01:22,740 --> 00:01:26,220 Once we are inside of the Array documentation, 21 00:01:26,220 --> 00:01:30,750 we get a list of methods all the way down on the left side here. 22 00:01:30,750 --> 00:01:35,610 This is going to be the different instance methods that are supported by Arrays. 23 00:01:37,350 --> 00:01:41,570 On the right side of the documentation, there will be an introduction. 24 00:01:41,570 --> 00:01:47,720 This isn't the same for every single class and module in Ruby Core however, 25 00:01:47,720 --> 00:01:52,280 there could be some nice examples in this part of the documentation. 26 00:01:52,280 --> 00:01:56,550 So we some examples of using an Array and what can be inside of an Array. 27 00:01:57,640 --> 00:02:03,950 Sometimes the documentation will give you little hints about how to use a class or 28 00:02:03,950 --> 00:02:08,500 module, and here is an example of that. 29 00:02:08,500 --> 00:02:11,859 If we wanna create an Array with separate objects, 30 00:02:11,859 --> 00:02:14,837 a block can be passed in to the Array instead. 31 00:02:16,504 --> 00:02:20,499 Now, if I hit the Back button, you can see there are more classes and 32 00:02:20,499 --> 00:02:23,140 modules that you might be familiar with. 33 00:02:23,140 --> 00:02:26,600 For example, Strings as part of Ruby Core. 34 00:02:28,540 --> 00:02:31,710 On the right side of the documentation 35 00:02:31,710 --> 00:02:35,870 are all of the different methods that are found in Ruby Core. 36 00:02:37,100 --> 00:02:42,930 These will have parenthesis on the ride side that shows you what class or 37 00:02:42,930 --> 00:02:44,300 module they come from. 38 00:02:45,320 --> 00:02:50,420 And, if we want to, we can filter these classes and methods. 39 00:02:50,420 --> 00:02:53,080 For example, if we wanted to see what classes and 40 00:02:53,080 --> 00:02:57,460 modules contained the word Object, we could do that. 41 00:02:57,460 --> 00:02:59,210 The methods can be interesting, too. 42 00:02:59,210 --> 00:03:03,000 If we want to filter the methods to see what's supported, for 43 00:03:03,000 --> 00:03:07,830 example the to_s method which converts something to a String. 44 00:03:07,830 --> 00:03:15,272 We can see all of these different classes and modules support the to_s method. 45 00:03:15,272 --> 00:03:19,265 Also to_i, to convert something to an integer. 46 00:03:19,265 --> 00:03:22,270 To_f for floating point. 47 00:03:23,540 --> 00:03:27,870 To_a for Array and to_h for Hatch. 48 00:03:30,690 --> 00:03:33,030 It's good to be familiar with the different classes and 49 00:03:33,030 --> 00:03:35,930 modules that are part of Ruby Core. 50 00:03:37,150 --> 00:03:38,220 Go ahead and 51 00:03:38,220 --> 00:03:42,230 take a look at all of the different ones here on the left side of the screen. 52 00:03:43,500 --> 00:03:48,090 Try looking around at the Ruby Core classes on your own now using Workspaces.