<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Linda Solis</title>
    <description>The latest articles on DEV Community by Linda Solis (@lindasolis).</description>
    <link>https://dev.to/lindasolis</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1127774%2Fdea80764-8d3d-443e-8e40-6feff3653fc7.png</url>
      <title>DEV Community: Linda Solis</title>
      <link>https://dev.to/lindasolis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lindasolis"/>
    <language>en</language>
    <item>
      <title>Ruby Codeacademy Learnings Notes</title>
      <dc:creator>Linda Solis</dc:creator>
      <pubDate>Tue, 01 Aug 2023 00:41:59 +0000</pubDate>
      <link>https://dev.to/lindasolis/ruby-codeacademy-learnings-notes-3f3o</link>
      <guid>https://dev.to/lindasolis/ruby-codeacademy-learnings-notes-3f3o</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Ruby file extension script*&lt;em&gt;.rb&lt;/em&gt;*&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Commenting&lt;/strong&gt; two types of comments&lt;br&gt;
&lt;strong&gt;Single line comments&lt;/strong&gt; &lt;br&gt;
start with a #.&lt;br&gt;
&lt;strong&gt;Multi line comments&lt;/strong&gt; start with =begin and end with =end.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;put&lt;/strong&gt; and &lt;strong&gt;print&lt;/strong&gt; commands can be used to display text in the console&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Variables:&lt;/strong&gt; There are four different types of variables in Ruby&lt;br&gt;
&lt;strong&gt;Local variables&lt;/strong&gt; &lt;br&gt;
must begin with a &lt;strong&gt;lowercase letter&lt;/strong&gt; or &lt;strong&gt;_&lt;/strong&gt;. These variables are local to the code block of the method they are declared in.&lt;br&gt;
&lt;strong&gt;Instance Variables&lt;/strong&gt;&lt;br&gt;
Instance variables begin with an &lt;strong&gt;@&lt;/strong&gt; symbol. Instance variables are variables that belong to an object.&lt;br&gt;
&lt;strong&gt;Class Variables&lt;/strong&gt;&lt;br&gt;
Class variables begin with an &lt;strong&gt;@@&lt;/strong&gt; sign. Class variables are available across different objects shared by all the descendants of the class. They must be initialized before use.&lt;br&gt;
&lt;strong&gt;Global Variables&lt;/strong&gt;&lt;br&gt;
Global variables begin with an &lt;strong&gt;$&lt;/strong&gt; symbol. While Class variables are not available across different classes, global variables are. Its scope is global, meaning that it can be accessed from anywhere in the program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Object Methods&lt;/strong&gt;&lt;br&gt;
everything in Ruby is an object, are built-in abilities of objects. To access an object’s methods, you need to call it using a &lt;strong&gt;.&lt;/strong&gt; and the method name. &lt;br&gt;
example: # Method to get the string reversed&lt;br&gt;
           print var*&lt;em&gt;.reverse&lt;/em&gt;*&lt;br&gt;
           # ymedacedoc&lt;br&gt;
&lt;strong&gt;.length&lt;/strong&gt; Ruby will return the length of the string (that is, the number of characters—letters, numbers, spaces, and symbols).&lt;br&gt;
&lt;strong&gt;.upcase&lt;/strong&gt; and &lt;strong&gt;.downcase&lt;/strong&gt; &lt;br&gt;
returns a version of the string in all uppercase or all lowercase &lt;/p&gt;

&lt;p&gt;example: name = "Jamie"&lt;br&gt;
           puts name*&lt;em&gt;.downcase.reverse.upcase&lt;/em&gt;*&lt;br&gt;
           # EIMAJ&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strings&lt;br&gt;
single quotation marks (&lt;strong&gt;‘’&lt;/strong&gt;) or double quotation marks (&lt;strong&gt;“”&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;string interpolation&lt;/strong&gt;&lt;br&gt;
used to insert the result of Ruby code into a string&lt;br&gt;
example: age = 30&lt;br&gt;
     print "I am #{age} years old"&lt;br&gt;
     # "I am 30 years old"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Get user input in Ruby&lt;/strong&gt;&lt;br&gt;
using &lt;strong&gt;gets.chomp&lt;/strong&gt;&lt;br&gt;
gets is the method used to retrieve user input. &lt;br&gt;
Ruby automatically adds a new line after each bit of input, so chomp is used to remove that extra line.&lt;br&gt;
example: print "Type your name and press Enter: "&lt;br&gt;
     name = &lt;strong&gt;gets.chomp&lt;/strong&gt;&lt;br&gt;
     puts "My name is #{name}!"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modulo&lt;br&gt;
returns the modular value, &lt;strong&gt;the remainder&lt;/strong&gt;, when two numbers are divided.&lt;br&gt;
example: puts 5*&lt;em&gt;.modulo&lt;/em&gt;&lt;em&gt;(3)&lt;br&gt;
     # Output: **2&lt;/em&gt;*&lt;br&gt;
5 is divided by 3 and the &lt;strong&gt;remainder is 2&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;User input Simple Program:&lt;br&gt;
print "What's your first name? "&lt;br&gt;
first_name = gets.chomp&lt;br&gt;
first_name.capitalize!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;print "What's your last name? "&lt;br&gt;
last_name = gets.chomp&lt;br&gt;
last_name.capitalize!&lt;/p&gt;

&lt;p&gt;puts "Your name is #{first_name} #{last_name}!"&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
