Codecast: Create a RubyGem 80: Refactor ConvenienceMethods - Part 2 @StatelessCode
Codecast: Create a RubyGem 80: Refactor ConvenienceMethods - Part 2  @StatelessCode
Uploaded October 2021 | Updated September 2026, 3 weeks ago
This is the 80th video in the NerdDice create a RubyGem series. In this video Mike continues refactoring the ConvenienceMethods module by trying to consolidate the three methods each for the roll_ and total_ patterns down to one method.

This video covers:
00:00:12 Introduction, review what we did in video 79 and what is left.
00:02:17 Modify get_number_to_keep_from_method_name so it can handle non-match situation
00:03:39 Refactor regular expressions further
00:09:34 Start condensing roll_ methods from 3 to 1
00:12:50 Create parse_number_to_keep private method
00:14:59 Fix issue of default number of dice on highest/lowest with consolidated roll_ method
00:19:55 Troubleshooting of remaining failures caused by consolidating
00:33:08 To be continued...

This session was split into two videos tune into NerdDice episode 81 Refactor ConvenienceMethods - Part 3 for the thrilling conclusion.


This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Codecast: Create a RubyGem 80: Refactor ConvenienceMethods - Part 2Codecast: Create a RubyGem 83: Ensure Adequate Commenting for ConvenienceMethods ModuleCodecast: Getting Started with Rails 7 14: Refactor into Comment PartialsCreate a RubyGem 92: Add Contributing Guidelines to the ProjectUpgrade a Rails 7 Application to Ruby 3.2.2Codecast: statelesscode.com WordPress 13: Upload Theme and Plugins to Real SiteNerdDice.com Retrospective 3 - The Retro that THEY Dont Want You to SeeChange RuboCop Config to Enable New Cops By Default for a Rails ApplicationCodecast: statelesscode.com WordPress 19: Add Actual Intended Styles to SidebarThe Path to Rails 8 - Upgrade Rails from 7.1 to 7.2Codecast: Create a RubyGem 82: Add method_missing methods to Benchmark ScriptAdd Coveralls to a Rails 7 Project
Stateless Code |

Codecast: Create a RubyGem 80: Refactor ConvenienceMethods - Part 2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER