<?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: brylenelavelle</title>
    <description>The latest articles on DEV Community by brylenelavelle (@brylenelavelle).</description>
    <link>https://dev.to/brylenelavelle</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%2F1036789%2F8f2cef9b-bf1d-44ae-84a7-1e166df62582.png</url>
      <title>DEV Community: brylenelavelle</title>
      <link>https://dev.to/brylenelavelle</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brylenelavelle"/>
    <language>en</language>
    <item>
      <title>Ruby: Times Iteration</title>
      <dc:creator>brylenelavelle</dc:creator>
      <pubDate>Wed, 08 Mar 2023 21:43:10 +0000</pubDate>
      <link>https://dev.to/brylenelavelle/ruby-times-iteration-3cn0</link>
      <guid>https://dev.to/brylenelavelle/ruby-times-iteration-3cn0</guid>
      <description>&lt;p&gt;Using a number to iterate that amount of times:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5.times do
  puts "Hello!"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;times&lt;/code&gt; method can also take a single argument. The &lt;code&gt;times&lt;/code&gt; index starts at 0:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5.times do |item|
  puts "Hello! #{item}"
end

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Ruby: Building a Grocery List Program Using Arrays and Hashes</title>
      <dc:creator>brylenelavelle</dc:creator>
      <pubDate>Wed, 08 Mar 2023 16:25:35 +0000</pubDate>
      <link>https://dev.to/brylenelavelle/ruby-building-a-grocery-list-program-using-arrays-and-hashes-j96</link>
      <guid>https://dev.to/brylenelavelle/ruby-building-a-grocery-list-program-using-arrays-and-hashes-j96</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def create_list
  # Prompts input from user
  print "What is the list name? "
  # Returns as value input to hash with key "name"
  name = gets.chomp
  # Creates hash assigned to variable hash
  # Variable "items" creates an array
  hash = { "name" =&amp;gt; name, "items" =&amp;gt; Array.new }
  return hash
end

def add_list_item
  # Prompts input from user
  print "What is the item called? "
  # Returns as value input to hash with key "item_name"
  item_name = gets.chomp

  print "How much? "
  # Returns as value input to hash with key "quantity"
  quantity = gets.chomp.to_i

  hash = { "name" =&amp;gt; item_name, "quantity" =&amp;gt; quantity }
  return hash
end

def print_separator(character= "-")
  puts character * 80
end

# To fancify the format of the printed list
def print_list(list)
  puts "List: #{list['name']}"
  print_separator()

  list["items"].each do |item|
    puts "\tItem: " + item['name'] + "\t\t\t" +
      "Quantity: " + item['quantity'].to_s
  end

  print_separator()
end

# Prints create_list
list = create_list()

puts "Great! Add some items to your list."
# Combines add_list_item hash to the 
# "items" array from create_list
# The three method calls also allows user to
# add items 3 times
list['items'].push(add_list_item())
list['items'].push(add_list_item())
list['items'].push(add_list_item())

puts "Here's your list:\n"
print_list(list)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fAWa5qu6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gj0v3hcse7fjax04owga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fAWa5qu6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gj0v3hcse7fjax04owga.png" alt="Image description" width="880" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ruby Arrays: Access, Insert, Count, and Include</title>
      <dc:creator>brylenelavelle</dc:creator>
      <pubDate>Tue, 07 Mar 2023 19:57:27 +0000</pubDate>
      <link>https://dev.to/brylenelavelle/ruby-arrays-access-insert-count-and-include-1m3i</link>
      <guid>https://dev.to/brylenelavelle/ruby-arrays-access-insert-count-and-include-1m3i</guid>
      <description>&lt;p&gt;array_list = ["milk", "eggs", "bread", "ice cream", "pie", "potatoes"]&lt;/p&gt;

&lt;p&gt;Accessing "milk" and assigning it to variable named "item"&lt;br&gt;
&lt;code&gt;item = array[0]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Printing first item in array:&lt;br&gt;
&lt;code&gt;puts.array.first&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Printing out last item in array:&lt;br&gt;
&lt;code&gt;puts array[-1]&lt;/code&gt;&lt;br&gt;
&lt;code&gt;puts array.last&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Return the number of items in an array:&lt;br&gt;
&lt;code&gt;array.length&lt;/code&gt;&lt;br&gt;
&lt;code&gt;array.count&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Return the number of items in the array based on the matches found:&lt;br&gt;
&lt;code&gt;array.count("eggs") # =&amp;gt; 1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To find out if a specific item is on the array list:&lt;br&gt;
&lt;code&gt;array.include?("eggs") # =&amp;gt; true&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ruby: Creating an Array and Addition Functions</title>
      <dc:creator>brylenelavelle</dc:creator>
      <pubDate>Tue, 07 Mar 2023 18:30:36 +0000</pubDate>
      <link>https://dev.to/brylenelavelle/ruby-creating-an-array-and-addition-functions-31g9</link>
      <guid>https://dev.to/brylenelavelle/ruby-creating-an-array-and-addition-functions-31g9</guid>
      <description>&lt;p&gt;Create an array:&lt;br&gt;
&lt;code&gt;array_name = []&lt;/code&gt;&lt;br&gt;
&lt;code&gt;array_name = Array.new&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding items to the array:&lt;br&gt;
&lt;code&gt;array = ["milk", "eggs", "bread"]&lt;/code&gt;&lt;br&gt;
&lt;code&gt;array = %w(milk eggs bread)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding "carrots" to the end of the array:&lt;br&gt;
&lt;code&gt;array &amp;lt;&amp;lt; "carrots"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding the string "potatoes" to the end of the array:&lt;br&gt;
&lt;code&gt;array.push("potatoes")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding the string "celery" to the beginning of the array:&lt;br&gt;
&lt;code&gt;array.unshift("celery")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding "ice cream" and "pie" to the end of the array"&lt;br&gt;
&lt;code&gt;array += ["ice cream", "pie"]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Adding the number 1 to the end of the array:&lt;br&gt;
&lt;code&gt;array &amp;lt;&amp;lt; 1&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to clear terminal in macOs</title>
      <dc:creator>brylenelavelle</dc:creator>
      <pubDate>Mon, 06 Mar 2023 19:05:19 +0000</pubDate>
      <link>https://dev.to/brylenelavelle/how-to-clear-terminal-in-macos-4n7b</link>
      <guid>https://dev.to/brylenelavelle/how-to-clear-terminal-in-macos-4n7b</guid>
      <description>&lt;p&gt;Type in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or press:&lt;br&gt;
control+command+L &lt;/p&gt;

</description>
    </item>
    <item>
      <title>How To Commit and Push Changes on GitHub</title>
      <dc:creator>brylenelavelle</dc:creator>
      <pubDate>Mon, 06 Mar 2023 18:45:12 +0000</pubDate>
      <link>https://dev.to/brylenelavelle/how-to-commit-and-push-changes-on-github-5g12</link>
      <guid>https://dev.to/brylenelavelle/how-to-commit-and-push-changes-on-github-5g12</guid>
      <description>&lt;p&gt;In the terminal, type in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git add --all
$ git commit -m "new changes"
$ git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
