Ruby Programming – 35 – Ruby Global Variables

Ruby programming tutorial on classes and global variables. This is part 2 of 2 of this lesson. We’ll be accessing our player info. We’ll also create a global variable within our class that we can call outside of the class. Links below.
★☆★ THE BEST EDITOR and IDE FOR PROGRAMMING ► http://bit.ly/Komodo-IDE-Learn-Ruby ★☆★

★☆★ SIGNUP TO GET MY RUBY BOOK FOR FREE ★☆★

http://bit.ly/free-book-signup

★☆★ FOLLOW ME BELOW ★☆★

Twitter ► http://bit.ly/jake-day-twitter

YouTube ► http://bit.ly/jake-day-youtube

Facebook ► http://bit.ly/jake-day-facebook

SoundCloud ► http://bit.ly/jake-day-soundcloud

★☆★ NOTES ★☆★

Comments

infinio11 says:

Great material, I can not wait for the next lesson. I would like to see more about “class”. I have downloaded the Komodo but seems like is a trial. Can you recommend another editor? Thanks.

Tim Blount says:

you have the best videos on Ruby that ive watched so far. Thank you

MrBen4853 says:

OMG THANK YOU SO MUCH!
The only place that helped me understand instance variables! THANK YOU.

Emil Waerstad says:

Loved this series!!! I want to make a game with the warriors and the game over thing in one of the previous video… Im not going to ask how to code it. That i wanna figure out my self. But how do i for eksaple put it in to my localhost?
I read some thing that Sinatra is good with ruby, but how do i get it from komodo in to my localhost using Sinatra???
Pls answer… And please continue the good work!
From: Emil 14

ihab hamed says:

thank you jake you tuts is awesome <3

Jessie Richardson says:

Thank you! These are great tutorials.

TheDerpCard says:

+Wild Academy cant wait til i get to this episode just wanted to see what the coding looked like 🙂

TheThonanth says:

$warrior_info, when called, will be equal to nil. He makes $warrior_info equal to the return value of the ‘puts’ methods call, rather than the string he is using in one of puts’ parameters.

Danny V says:

Great tutorial. Thanks for sharing!

Teague Vox says:

I followed along with the tutorial though I noticed at the end I assume you’re calling the $warrior_info line but it will return it in the line you’re presumably defining it in, evidenced by the fact it will return before the player_one and player_two class calls. I can comment out $warrior_info at the end of the code and it behaves the same way. So how do I use this global variable?

Bennett Marcelo says:

you wanna be a good programmer, do drugs… JK man great videos, they’ve helped me a lot

Rodrigo Santos says:

Another great job!  I’m going to print most of the code examples from your tutorials and use them as a fast reference guide, it will definitely help me memorizing the syntax and structure of the language. Thanks again! 

Kamil_boy says:

i know its been long but with the code: player_1 = Warrior.new (‘Razer’,’WhiteFox’,21,45) there seems to be a bugg or something because it says syntax error, unexpected ‘,’, expecting ‘)’ but i cant solve it in any way

Adam Recvlohe says:

I went through all the tutorials and you really helped me to understand Ruby much better. Thank you!

fiazkou says:

Great stuff! Sad to have one lesson left… I was wondering if you would recommend reading your book if the person already went through all these videos? meanwhile you finish the Php tutorials, would you recommend us any other source to learn? or possible steps we could make.

Thanks in advance!

Shanmuga Shanker says:

Its good . But please cut back on the caffeine (*weed*) !

Vienas Du says:

i work on ruby 2.2.3 ruby version and after binging code into the command prop i get this syntax error. Unexpected ‘,’ expecting end_of_input player_1 = Warrior.new(“Raze”,”WhiteFox”, “23”,”21″) Could anyone help me with this error?

Emil Waerstad says:

Heyyy Jake. was just wondering if you could please answear my other question?
“Loved this series!!! I want to make a game with the warriors and the game over thing in one of the previous video… Im not going to ask how to code it. That i wanna figure out my self. But how do i for eksaple put it in to my localhost?
I read some thing that Sinatra is good with ruby, but how do i get it from komodo in to my localhost using Sinatra???
Pls answer… And please continue the good work!
From: Emil 14 ”

And btw i have the game rdy now i have coded it all by my self with just the knowlege i got from this vids so thank you very much for teaching me! 😀
And i was altso wondering if this ruby series is going to continue since in ur vids you are talking about vid 50 and stuff like that…

LeAlan Carter says:

Well crap… I caught up. These have been great tutorials! Can’t wait to see the rest, but I am going to try to jump ahead a little bit by checking out some books, and other tutorials as well. 

Jim Joyce says:

Just wanted to send along a big thank you! I was searching all over for an explanation of ruby classes and you had the most easily understood explanation and example. I’ll definitely be checking out the other Wild Academy videos 🙂

Kewendi says:

Thanks for a great lesson on classes.

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!