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.
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.