0:00:00.060,0:00:03.129 [Music] 0:00:03.600,0:00:06.720 our instructions say 0:00:04.720,0:00:08.880 create a module that you can mix into 0:00:06.720,0:00:11.360 one of your subclasses that describes a 0:00:08.880,0:00:12.880 behavior unique to that subclass 0:00:11.360,0:00:14.639 okay so that's open-ended enough that 0:00:12.880,0:00:16.240 you can take this a bunch of different 0:00:14.639,0:00:18.320 directions and be creative 0:00:16.240,0:00:19.600 but we're going to show one of the 0:00:18.320,0:00:22.080 options 0:00:19.600,0:00:23.519 so i'm going to create a module called 0:00:22.080,0:00:26.560 towable 0:00:23.519,0:00:29.279 see that module towable and following 0:00:26.560,0:00:31.279 ruby convention to end modules with the 0:00:29.279,0:00:33.520 elbows like walkable towable 0:00:31.279,0:00:35.120 things like that and we're going to 0:00:33.520,0:00:37.840 create a method 0:00:35.120,0:00:38.879 called can toe question mark and then 0:00:37.840,0:00:41.680 put in 0:00:38.879,0:00:43.600 an amount of pounds and we'll use a 0:00:41.680,0:00:47.440 ternary operator to say 0:00:43.600,0:00:50.559 if pounds is greater than 2 000 0:00:47.440,0:00:53.680 then the answer is false 0:00:50.559,0:00:54.879 otherwise it's true so basically if it's 0:00:53.680,0:00:56.719 over 2 000 pounds 0:00:54.879,0:00:58.879 then you can't but if it's less than 0:00:56.719,0:00:59.199 then it's true and we're going to mix 0:00:58.879,0:01:02.800 this 0:00:59.199,0:01:06.000 in to my truck which means we use the 0:01:02.800,0:01:08.799 keyword include and we'll say 0:01:06.000,0:01:09.680 include towable so now let's try to use 0:01:08.799,0:01:11.760 this on 0:01:09.680,0:01:12.799 my car simply to show that we shouldn't 0:01:11.760,0:01:16.880 be able to 0:01:12.799,0:01:20.479 so we'll say can tow and let's say 0:01:16.880,0:01:23.280 300 and 0:01:20.479,0:01:25.119 we'll save puts as well so now if we try 0:01:23.280,0:01:28.320 to run this 0:01:25.119,0:01:30.000 okay we get an undefined method can tow 0:01:28.320,0:01:31.520 for the my car class which makes sense 0:01:30.000,0:01:32.640 because we didn't include it into that 0:01:31.520,0:01:36.720 class 0:01:32.640,0:01:39.520 but what if we change this to my truck 0:01:36.720,0:01:41.119 so let's run this and it's true great so 0:01:39.520,0:01:43.439 it has access to that method 0:01:41.119,0:01:44.960 and it's returning what it's supposed to 0:01:43.439,0:01:46.240 but just to make sure it returns false 0:01:44.960,0:01:47.840 when it should let's say four 0:01:46.240,0:01:50.240 thousand pounds so that should give us 0:01:47.840,0:01:55.840 back false 0:01:50.240,0:01:55.840 and it does 0:01:57.040,0:01:59.119 you