@StatelessCode
  @StatelessCode
Stateless Code | Codecast: Create a RubyGem 70: Add Bonus to ConvenienceMethods @StatelessCode | Uploaded October 2021 | Updated October 2024, 27 minutes ago.
This is the 70th video in the NerdDice create a RubyGem series. In this video Mike tackles the use case of allowing the user to add in a bonus to the dynamic method_missing ConvenienceMethods module so that it will properly respond to a method like roll_1d4_plus_6 or roll_22d8_plus40 will work and properly add the bonus to the total.

This video covers:
00:00:12 Introduction
00:01:38 Copy and adapt spec scenarios for the use case roll_NdN_plusN and ensure failing
00:05:58 Start implementing the roll_NdN_plusN use case
00:08:32 Create private method get_bonus_from_method_name with help from console and Rubular
00:13:42 Write private method to raise error if bonus in method name does not match bonus in keyword arguments
00:17:55 Add spec for bonus integrity failure situation
00:19:19 Troubleshoot spec failures for roll_NdN_plusN
00:40:01 Fix RuboCop failures
00:42:25 Review git diff, commit, and push code


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 70: Add Bonus to ConvenienceMethodsCreate a RubyGem 101: Retro on Version 0.5.0 and Patch ReleasesOverview of Authentication Epic and Choosing DeviseCodecast: Getting Started with Rails 7 07: Create Articles in the ApplicationCodecast: Getting Started with Rails 7 03: Autoloading, Generate and Migrate a ModelUpgrade Sublime Text from Version 3 to 4 on UbuntuFix a Documentation Bug Referring to the Wrong ProjectWrite Devise System Tests for Password Change via FormInstall Visual Studio Code on Ubuntu 24.04Codecast: Create a RubyGem 75: Test Drive in the Console and Try to Break ThingsRemove the Webdrivers Gem from a Rails 7 App and Update Selenium WebdriverCodecast: statelesscode.com WordPress 14: Add Finishing Touches and Launch the Site

Codecast: Create a RubyGem 70: Add Bonus to ConvenienceMethods @StatelessCode

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER