Artwork

Andrew Mason and Julie J에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 Andrew Mason and Julie J 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.
Player FM -팟 캐스트 앱
Player FM 앱으로 오프라인으로 전환하세요!

Favorite Ruby Methods: Part 1

31:01
 
공유
 

저장한 시리즈 ("피드 비활성화" status)

When? This feed was archived on October 11, 2025 21:10 (2M ago). Last successful fetch was on June 06, 2024 13:47 (1+ y ago)

Why? 피드 비활성화 status. 잠시 서버에 문제가 발생해 팟캐스트를 불러오지 못합니다.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 354268935 series 3375882
Andrew Mason and Julie J에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 Andrew Mason and Julie J 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.

On this episode of Ruby for All, Andrew and Julie discuss the cold temps where they live, their preferences for warmer temps, using layers to cope with the changing temperatures, and their experiences with snow sports. For the month of February, get ready because Andrew and Julie are doing something fun! They’ll be going through some of their favorite Ruby methods all month on every episode, focusing on a different type of object type. Today’s methods they discuss are map, flatten, uniq, shuffle, sample, count, any, and all. And, if that’s not enough, they also talk about Spaceship Operator and enumerator. If they missed your favorite array or they didn’t explain something well, let them know on Twitter. Download this episode now!

[00:05:11] Andrew and Julie want to make February fun, so they tell us what they’re doing and how Julie came across this idea.

[00:06:32] Let’s start with Andrew’s favorite method, the array object, which is map.

[00:08:46] Array flatten is another one Andrew likes and he explains what it does, as well as flat map. Does flatten work on nested arrays?

[00:11:20] Julie tells us flatten passing in zero just returns the same way and explains what she noticed when using methods, and Andrew had no idea that you could pass level to flatten until now.

[00:12:15] The next method is uniq, which returns a new array, but only the ones that are not duplicated. Julie wonders if you can pass in a parameter or a block with this.

[00:15:54] Andrew doesn’t use this next method a lot which is shuffle, and this returns a new array with the elements of self-shuffled, self being the array this is called on. Did you know you can pass random to it?

[00:16:40] Julie brings up the next method which is sample on an array. Sample returns a random element from the array, and we hear she used shuffle and sample in practice.

[00:18:20] The last method is count, which returns the count of specified elements, and if you don’t pass it a block or an argument, it will return the count of all elements.

[00:20:55] When would you want to use a SQL count query versus not? Andrew talks about a great article you can check out on ActiveRecord, and to clarify, dot length is something you would NOT want to use with ActiveRecord, use size.

[00:22:02] Julie tells us she will use size and not worry if it’s loaded or not and Andrew reads something from an article Nate Berkopec wrote.

[00:22:46] The next method is min/max which returns a two-element array containing the minimum and the maximum value, and Andrew does his best to explain what Spaceship Operator and enumerator are.

[00:28:17] Julie touches on some other methods, these aliases for example, maps alias is collect, and filter select, inject, reject, detect, and inspect. There is one more array that Julie brings up which is any, all, none where you can pass the any method and a block, and it will return true if any one of the elements met that criteria.

Panelists:

Andrew Mason

Julie J.

Sponsors:

Honeybadger

GoRails

Links:

Andrew Mason Twitter

Andrew Mason Website

Julie J. Twitter

Julie J. Website

3 ActiveRecord Mistakes That Slow Down Rails Apps: Count, Where and Present-by Nate Berkopec of speedshop
Ruby’s Spaceship Operator-Tech Talent South

  continue reading

69 에피소드

Artwork

Favorite Ruby Methods: Part 1

Ruby for All

12 subscribers

published

icon공유
 

저장한 시리즈 ("피드 비활성화" status)

When? This feed was archived on October 11, 2025 21:10 (2M ago). Last successful fetch was on June 06, 2024 13:47 (1+ y ago)

Why? 피드 비활성화 status. 잠시 서버에 문제가 발생해 팟캐스트를 불러오지 못합니다.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 354268935 series 3375882
Andrew Mason and Julie J에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 Andrew Mason and Julie J 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.

On this episode of Ruby for All, Andrew and Julie discuss the cold temps where they live, their preferences for warmer temps, using layers to cope with the changing temperatures, and their experiences with snow sports. For the month of February, get ready because Andrew and Julie are doing something fun! They’ll be going through some of their favorite Ruby methods all month on every episode, focusing on a different type of object type. Today’s methods they discuss are map, flatten, uniq, shuffle, sample, count, any, and all. And, if that’s not enough, they also talk about Spaceship Operator and enumerator. If they missed your favorite array or they didn’t explain something well, let them know on Twitter. Download this episode now!

[00:05:11] Andrew and Julie want to make February fun, so they tell us what they’re doing and how Julie came across this idea.

[00:06:32] Let’s start with Andrew’s favorite method, the array object, which is map.

[00:08:46] Array flatten is another one Andrew likes and he explains what it does, as well as flat map. Does flatten work on nested arrays?

[00:11:20] Julie tells us flatten passing in zero just returns the same way and explains what she noticed when using methods, and Andrew had no idea that you could pass level to flatten until now.

[00:12:15] The next method is uniq, which returns a new array, but only the ones that are not duplicated. Julie wonders if you can pass in a parameter or a block with this.

[00:15:54] Andrew doesn’t use this next method a lot which is shuffle, and this returns a new array with the elements of self-shuffled, self being the array this is called on. Did you know you can pass random to it?

[00:16:40] Julie brings up the next method which is sample on an array. Sample returns a random element from the array, and we hear she used shuffle and sample in practice.

[00:18:20] The last method is count, which returns the count of specified elements, and if you don’t pass it a block or an argument, it will return the count of all elements.

[00:20:55] When would you want to use a SQL count query versus not? Andrew talks about a great article you can check out on ActiveRecord, and to clarify, dot length is something you would NOT want to use with ActiveRecord, use size.

[00:22:02] Julie tells us she will use size and not worry if it’s loaded or not and Andrew reads something from an article Nate Berkopec wrote.

[00:22:46] The next method is min/max which returns a two-element array containing the minimum and the maximum value, and Andrew does his best to explain what Spaceship Operator and enumerator are.

[00:28:17] Julie touches on some other methods, these aliases for example, maps alias is collect, and filter select, inject, reject, detect, and inspect. There is one more array that Julie brings up which is any, all, none where you can pass the any method and a block, and it will return true if any one of the elements met that criteria.

Panelists:

Andrew Mason

Julie J.

Sponsors:

Honeybadger

GoRails

Links:

Andrew Mason Twitter

Andrew Mason Website

Julie J. Twitter

Julie J. Website

3 ActiveRecord Mistakes That Slow Down Rails Apps: Count, Where and Present-by Nate Berkopec of speedshop
Ruby’s Spaceship Operator-Tech Talent South

  continue reading

69 에피소드

모든 에피소드

×
 
Loading …

플레이어 FM에 오신것을 환영합니다!

플레이어 FM은 웹에서 고품질 팟캐스트를 검색하여 지금 바로 즐길 수 있도록 합니다. 최고의 팟캐스트 앱이며 Android, iPhone 및 웹에서도 작동합니다. 장치 간 구독 동기화를 위해 가입하세요.

 

빠른 참조 가이드

탐색하는 동안 이 프로그램을 들어보세요.
재생