How to Work with Required and Optional Keyword Arguments in Ruby 3

  Рет қаралды 1,950

edutechional

edutechional

Күн бұрын

Ruby offers multiple ways to work with keyword arguments, including setting a list of required, named arguments, along with optional arguments. In this guide we'll walk through how to work with both options.
Source code: github.com/jor...

Пікірлер: 13
@leecherlarry
@leecherlarry 3 жыл бұрын
long time no see! good luck man! i m watching tennis now 😁
@edutechional
@edutechional 3 жыл бұрын
Welcome back!
@leecherlarry
@leecherlarry 3 жыл бұрын
@@edutechional thx! I'm back at programming with Wolfram L, i.e. writing down probability theory highschool textbook problem solutions in Mathematica, incl solving them thru WL code. much fun! #studyathome. I'll upgrade to blitzstein very soon. that's college level intro.
@Deletedeletedelete
@Deletedeletedelete 3 жыл бұрын
It works in ruby 2.3 too :)
@edutechional
@edutechional 3 жыл бұрын
This syntax does, but Ruby 3 did introduce a few breaking changes for keyword arguments. So a few ways that worked in 2 no longer work in 3.
@yugeshpalvai4946
@yugeshpalvai4946 3 жыл бұрын
Hey Jordon, Please make a video on rack-mini-profiler thing, which is default from rails 6.1
@edutechional
@edutechional 3 жыл бұрын
Thanks, I'll keep that in mind for future videos
@em_the_bee
@em_the_bee 3 жыл бұрын
5:40 How do I find such an extension that evaluates expressions via commening the code? Or is it standard for Vim? Looks much better than printing everything to console. Is there one for VS Code?
@edutechional
@edutechional 3 жыл бұрын
It's a vim plugin that connects to the seeing is believing gem, if you're interested, I built out a full course on Vim for Ruby developers that shows how to build that (and my full setup): www.udemy.com/course/vim-training-course-ruby-developers/
@BeeRich33
@BeeRich33 3 жыл бұрын
email: and password: are empty default value entries of that hash?
@edutechional
@edutechional 3 жыл бұрын
They're not default values, they're required named arguments for the method
@codeline9387
@codeline9387 3 жыл бұрын
it's not optional key words it's a hash
@edutechional
@edutechional 3 жыл бұрын
It uses the hash data structure, but it functions as a set of optional key word arguments.
SDK Tutorial - Getting Config Diffs Using Snapshots
4:32
Build a QR Code Generator in Ruby
12:16
edutechional
Рет қаралды 2 М.
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 52 МЛН
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 8 МЛН
Deep Dive into Website Animations with Scss
35:25
edutechional
Рет қаралды 3,3 М.
Automate your Development Workflow with Terminal Shortcuts
9:18
How to Call and Render API Data in React
57:09
edutechional
Рет қаралды 8 М.
No, Einstein Didn’t Solve the Biggest Problem in Physics
8:04
Sabine Hossenfelder
Рет қаралды 295 М.
JavaScript Loops Explained
10:53
Dev Doug
Рет қаралды 49
Capitalize Every Word with JavaScript / TypeScript
13:09
edutechional
Рет қаралды 2,2 М.
Here's How NVIDA's New 'Eagle Eye' Will Change The World Forever
10:41
How to Utilize React's Context API to Build a Login Form
41:22
edutechional
Рет қаралды 8 М.
How to Think like a Programmer
1:45:15
Niklas Borson
Рет қаралды 284
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 52 МЛН