У нас вы можете посмотреть бесплатно 4 Variable Types In Ruby (1 Min) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this tutorial, you'll learn four different types of variables in Ruby programming language. — Facebook: / gokcedbsql — Video Transcript: — Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn four types of variables in Ruby. Number one, a global variable starts with a dollar sign, and an uninitialized global variable will have the value of nil or empty. On line two, I'm declaring a global variable called company underscore name which I'm printing on line 22. Number two, a class variable starts with two at signs and must be initialized before it can be used in methods. On line six, I'm initializing a class variable called the number of customers which I'm printing in the get number of customers method on line 17. Number three, an instance variable starts with an additional sign, and an uninitialized instance variable will have of nil. Starting on line 9, I'm defining three instance variables called customer id, customer id, customer name, and customer mailing address. On line 14, I have a method called get customer details which is printing the value of these three instance variables. Last but not the least number four. A local variable starts with a lowercase letter or an underscore. A local variable scope is local to the code construct in which they are declared. In this example, I have three local variables a, b, and underscore result. On line 35, I'm printing the sum of a and b. There you have it. Make sure you like, subscribe, and turn on the notification bell. Until next time. Connect MySQL In Python: • How To Connect To MySQL In Python (2 Min) ... Run Selenium PyTests In Parallel: • How To Run Selenium PyTests In Parallel (2... Find_elements() in Selenium: • How To: Find_Elements() In Selenium (3 Min... — 1. global variables start with $, uninitialized global variables have the value of nil (empty) $company_name = "ABC Corp" class Customer 2. class variables starts with @@ and must be initialized before they can be used in methods @@number_of_customers = 0 def initialize(id, name, mailing_address) 3. instance variables starts with @, uninitialized instance variables have the value nil @customer_id = id @customer_name = name @customer_mailing_address = mailing_address @@number_of_customers += 1 end def get_customer_details puts "id: #{@customer_id}, name: #{@customer_name}, address: #{@customer_mailing_address}" end def get_number_of_customers puts "Number of customers: #{@@number_of_customers}" end end puts "Company Name: #{$company_name}" customer1 = Customer.new("1", "John Smith", "123 Main St.") customer2 = Customer.new("2", "Sally Jones", "456 Second St.") customer1.get_customer_details customer2.get_customer_details customer2.get_number_of_customers END { 4. local variables start with lower case letter or _. Local to the code construct in which they are declared a = 10 b = 20 _result = a + b puts "Result: #{_result}" }