{"id":39701,"date":"2025-07-11T09:45:12","date_gmt":"2025-07-11T09:45:12","guid":{"rendered":"https:\/\/www.railscarma.com\/?p=39701"},"modified":"2025-07-12T04:51:03","modified_gmt":"2025-07-12T04:51:03","slug":"ruby-loops-explained-mastering-for-while-until-and-loop-do","status":"publish","type":"post","link":"https:\/\/www.railscarma.com\/it\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/","title":{"rendered":"I cicli di Ruby spiegati: Padroneggiare i cicli for, while, until e do"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"39701\" class=\"elementor elementor-39701\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a22c3e4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a22c3e4\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-586b375\" data-id=\"586b375\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7722b73 elementor-widget elementor-widget-text-editor\" data-id=\"7722b73\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Ruby, a dynamic and expressive programming language, is celebrated for its simplicity and developer-friendly syntax. One of its core features for controlling program flow is loops, which allow developers to execute code repeatedly based on conditions or iterations. In Ruby, the primary loop constructs are <code>for, while, until,<\/code> E <code>loop do<\/code>. Each serves distinct purposes, and understanding their nuances is key to writing idiomatic and efficient Ruby code. This article dives deep into these loops, exploring their syntax, use cases, best practices, and practical examples, while highlighting Ruby\u2019s unique approach to iteration. By the end, you\u2019ll have a comprehensive understanding of when and how to use each loop effectively.<\/p><h3><strong>Introduction to Loops in Ruby<\/strong><\/h3><p>Loops are fundamental to programming, enabling repetitive tasks, iteration over collections, and dynamic control flow. In Ruby, loops are designed to be intuitive, aligning with the language\u2019s philosophy of prioritizing developer happiness. While Ruby offers powerful enumerable methods like <code>each, map<\/code>, E <code>reduce<\/code>, traditional loops (<code>for, while, until<\/code>, E <code>loop do<\/code>) remain essential for specific scenarios. This article covers:<\/p><ul><li>Syntax and mechanics of each loop.<\/li><li>Practical use cases with examples.<\/li><li>Comparisons to highlight when to use each.<\/li><li>Common pitfalls, best practices, and alternatives.<\/li><\/ul><p>Let\u2019s start by exploring each loop type in detail.<\/p><h3><strong>The for Loop: Iterating Over Collections<\/strong><\/h3><h5><strong>Syntax and Mechanics<\/strong><\/h5><p>Il <code>per<\/code> loop in Ruby is used to iterate over a collection (like an array or hash) or a range. Its syntax is straightforward:<\/p><pre>ruby\nfor variable in collection\n    # Code block\nend<\/pre><p>Qui, <code>variable<\/code> takes on each element of <code>collezione<\/code> (e.g., an array or range) in sequence.<\/p><h5><strong>Example<\/strong><\/h5><p>Let\u2019s iterate over an array of numbers to calculate their sum:<\/p><pre>ruby\nnumbers = [1, 2, 3, 4, 5]\nsum = 0\nfor num in numbers\n    sum += num\nend\nputs \"Sum: #{sum}\" # Output: Sum: 15<\/pre><p>Or, using a range to print numbers from 1 to 5:<\/p><pre>ruby\nfor i in 1..5\n    puts i\nend\n# Output: 1, 2, 3, 4, 5<\/pre><h5><strong>Use Cases<\/strong><\/h5><ul><li>Iterating over fixed arrays or ranges (e.g., generating a sequence of numbers).<\/li><li>Simple scripts where readability is prioritized over flexibility.<\/li><\/ul><h5><strong>Pros and Cons<\/strong><\/h5><ul><li><strong>Professionisti:<\/strong> Simple and readable for beginners; works well with ranges and small collections.<\/li><li><strong>Contro:<\/strong> Less flexible than other loops; Rubyists often prefer each for collections due to its block-based syntax and functional style.<\/li><\/ul><h5><strong>Notes<\/strong><\/h5><p>Mentre <code>per<\/code> is intuitive, it\u2019s less idiomatic in Ruby. The <code>ciascuno<\/code> method is often preferred because it aligns with Ruby\u2019s enumerable philosophy and avoids polluting the outer scope with loop variables.<\/p><h3><strong>The while Loop: Condition-Driven Iteration<\/strong><\/h3><h5><strong>Syntax and Mechanics<\/strong><\/h5><p>Il <code>while<\/code> loop executes a block of code as long as a condition is true:<\/p><pre>ruby\nwhile condition\n# Code block\nend<\/pre><p>The loop continues until the condition evaluates to <code>falso<\/code>.<\/p><h5><strong>Example<\/strong><\/h5><p>Let\u2019s use a <code>while<\/code> loop to count down from 5:<\/p><pre>ruby\ncount = 5\nwhile count &gt; 0\nputs count\ncount -= 1\nend\n# Output: 5, 4, 3, 2, 1<\/pre><p>Or, reading user input until a specific command is entered:<\/p><pre>ruby\ninput = \"\"\nwhile input != \"quit\"\nputs \"Enter a command (type 'quit' to exit):\"\ninput = gets.chomp\nend<\/pre><h5><strong>Use Cases<\/strong><\/h5><ul><li>Looping based on dynamic conditions (e.g., waiting for user input or a resource).<\/li><li>Situations where the number of iterations isn\u2019t known in advance.<\/li><\/ul><h5><strong>Pros and Cons<\/strong><\/h5><ul><li><strong>Professionisti:<\/strong> Ideal for condition-based looping; flexible for dynamic scenarios.<\/li><li><strong>Contro:<\/strong> Risk of infinite loops if the condition isn\u2019t updated properly.<\/li><\/ul><h5><strong>Notes<\/strong><\/h5><p>Always ensure the condition will eventually become <code>falso<\/code> to avoid infinite loops. Debugging tools like <code>puts<\/code> or the <code>debug<\/code> gem can help trace condition changes.<\/p><h3><strong>The until Loop: The Opposite of while<\/strong><\/h3><h5><strong>Syntax and Mechanics<\/strong><\/h5><p>Il <code>until<\/code> loop is the inverse of <code>while<\/code>, running until a condition becomes true:<\/p><pre>ruby\nuntil condition\n# Code block\nend<\/pre><p>It\u2019s equivalent to <code>while !condition<\/code>.<\/p><h5><strong>Example<\/strong><\/h5><p>Let\u2019s rewrite the countdown example using <code>until<\/code>:<\/p><pre>ruby\ncount = 5\nuntil count == 0\n    puts count\n    count -= 1\nend\n# Output: 5, 4, 3, 2, 1<\/pre><p>Or, waiting for a valid user input:<\/p><pre>ruby\ninput = \"\"\nuntil input == \"yes\" || input == \"no\"\n    puts \"Please enter 'yes' or 'no':\"\n    input = gets.chomp\nend<\/pre><h5><strong>Use Cases<\/strong><\/h5><ul><li>Scenarios where the \u201cuntil\u201d phrasing feels more natural (e.g., waiting for a condition to be met).<\/li><li>Simplifying logic for certain negative conditions.<\/li><\/ul><h5><strong>Pros and Cons<\/strong><\/h5><ul><li><strong>Professionisti:<\/strong> Readable for \u201cuntil\u201d logic; reduces need for negated conditions.<\/li><li><strong>Contro:<\/strong> Less commonly used; same infinite loop risks as <code>while<\/code>.<\/li><\/ul><h5><strong>Notes<\/strong><\/h5><p><code>until<\/code> is syntactic sugar for <code>while !condition<\/code>. Use it when it improves clarity, but it\u2019s not mandatory.<\/p><h3><strong>The loop do Construct: Flexible and Infinite<\/strong><\/h3><h5><strong>Syntax and Mechanics<\/strong><\/h5><p>Il <code>loop do<\/code> construct creates an infinite loop that must be explicitly exited using <code>break<\/code>:<\/p><pre>ruby\nloop do\n    # Code block\n    break if condition\nend<\/pre><p>It\u2019s highly flexible and often paired with control statements like <code>break<\/code> o <code>next<\/code>.<\/p><h5><strong>Example<\/strong><\/h5><p>Let\u2019s simulate a simple task queue:<\/p><pre>ruby\nqueue = [\"task1\", \"task2\", \"task3\"]\nloop do\n    break if queue.empty?\n    task = queue.shift\n    puts \"Processing #{task}\"\nend\n# Output: Processing task1, Processing task2, Processing task3<\/pre><p>Or, a retry mechanism with a limit:<\/p><pre>ruby\nattempts = 0\nloop do\n    attempts += 1\n    puts \"Attempt #{attempts}\"\n    break if attempts &gt;= 3\nend\n# Output: Attempt 1, Attempt 2, Attempt 3<\/pre><h5><strong>Use Cases<\/strong><\/h5><ul><li>Complex or indefinite iterations (e.g., game loops, server listeners).<\/li><li>Scenarios requiring manual control over loop termination.<\/li><\/ul><h5><strong>Pros and Cons<\/strong><\/h5><ul><li><strong>Professionisti:<\/strong> Maximum flexibility; no predefined condition.<\/li><li><strong>Contro:<\/strong> Requires explicit <code>break<\/code> to avoid infinite loops.<\/li><\/ul><h5><strong>Notes<\/strong><\/h5><p><code>loop do<\/code> is powerful but demands careful management. Use <code>break, next<\/code>, o <code>redo<\/code> to control flow effectively.<\/p><h3><strong>Ruby Loops Control Statements<\/strong><\/h3><p>All Ruby loops support control statements to manage flow:<\/p><ul><li><code>break<\/code>: Exits the loop entirely.<\/li><\/ul><pre>ruby\nfor i in 1..10\n    break if i &gt; 5\n    puts i\nend\n# Output: 1, 2, 3, 4, 5<\/pre><ul><li><code>next<\/code>: Skips to the next iteration.<\/li><\/ul><pre>ruby\nfor i in 1..5\n    next if i.even?\n    puts i\nend\n# Output: 1, 3, 5<\/pre><ul><li><code>redo<\/code>: Restarts the current iteration.<\/li><\/ul><pre>ruby\ni = 0\nwhile i &lt; 3\n    i += 1\n    puts i\n    redo if i == 2\nend\n# Output: 1, 2, 2, 3 (repeats 2)<\/pre><p>These statements enhance flexibility, especially in <code>loop do<\/code>.<\/p><h3><strong>Comparing Ruby\u2019s Loops<\/strong><\/h3><table><tbody><tr><th>Loop<\/th><th>Best For<\/th><th>Condition<\/th><th>Idiomatic?<\/th><\/tr><tr><td><code>per<\/code><\/td><td>Fixed ranges\/collections<\/td><td>Predefined iterations<\/td><td>Less common; prefer <code>ciascuno<\/code><\/td><\/tr><tr><td><code>while<\/code><\/td><td>Dynamic conditions<\/td><td>Runs while true<\/td><td>Common for condition-driven tasks<\/td><\/tr><tr><td><code>until<\/code><\/td><td>Inverse conditions<\/td><td>Runs until true<\/td><td>Less common but readable<\/td><\/tr><tr><td><code>loop do<\/code><\/td><td>Complex\/indefinite iterations<\/td><td>Manual exit with <code>break<\/code><\/td><td>Flexible but requires caution<\/td><\/tr><\/tbody><\/table><p>Ruby\u2019s enumerable methods (<code>each, map<\/code>, etc.) often replace <code>per<\/code> for collections, but traditional loops shine in specific scenarios.<\/p><h3><strong>Common Pitfalls and Best Practices for Ruby Loops<\/strong><\/h3><ul><li><strong>Avoiding Infinite Loops<\/strong><ul><li>Always update conditions in <code>while, until<\/code>, o <code>loop do<\/code>.<\/li><li>Example: Ensure a counter increments or a condition changes.<\/li><li>Debugging tip: Add <code>puts<\/code> to log loop progress.<\/li><\/ul><\/li><li><strong>Prefer Enumerables for Collections<\/strong><ul><li>Utilizzo <code>ciascuno<\/code> invece di <code>per<\/code> for arrays or hashes:<\/li><\/ul><\/li><\/ul><pre>ruby\nnumbers = [1, 2, 3]\nnumbers.each { |n| puts n } # More idiomatic than for<\/pre><ul><li><strong>Keep Loops Readable<\/strong><ul><li>Avoid deeply nested loops; extract logic to methods.<\/li><li>Use descriptive variable names (e.g., <code>user<\/code> invece di <code>u<\/code>).<\/li><\/ul><\/li><li><strong>Handle Edge Cases<\/strong><ul><li>Check for empty collections or nil values:<\/li><\/ul><\/li><\/ul><pre>ruby\narray = []\nfor item in array\n    puts item\nend # Safe, but no output<\/pre><h3><strong>Ruby Loops Practical Examples<\/strong><\/h3><h5><strong>1. Summing Numbers with <code>per<\/code><\/strong><\/h5><pre>ruby\nnumbers = [10, 20, 30]\ntotal = 0\nfor num in numbers\n    total += num\nend\nputs \"Total: #{total}\" # Output: Total: 60<\/pre><h5><strong>2. Processing Input with <code>while<\/code><\/strong><\/h5><pre>ruby\nbalance = 100\nwhile balance &gt; 0\n    puts \"Balance: #{balance}. Withdraw amount:\"\n    withdrawal = gets.chomp.to_i\n    balance -= withdrawal if withdrawal &lt;= balance\nend\nputs \"Insufficient funds!\"<\/pre><h5><strong>3. Validating Input with <code>until<\/code><\/strong><\/h5><pre>ruby\nresponse = \"\"\nuntil response.match?(\/\\A[1-5]\\z\/)\n    puts \"Enter a number between 1 and 5:\"\n    response = gets.chomp\nend\nputs \"You entered: #{response}\"<\/pre><h5><strong>4. Game Loop with <code>loop do<\/code><\/strong><\/h5><pre>ruby\nscore = 0\nloop do\n    puts \"Current score: #{score}. Play again? (y\/n)\"\n    break if gets.chomp.downcase == \"n\"\n    score += rand(1..10)\nend\nputs \"Final score: #{score}\"<\/pre><h3><strong>Advanced Ruby Loops<\/strong><\/h3><h5><strong>Nested Loops<\/strong><\/h5><p>Nested loops are useful for multi-dimensional data, like generating a multiplication table:<\/p><pre>ruby\nfor i in 1..3\n    for j in 1..3\n        print \"#{i * j} \"\n    end\n    puts\nend\n# Output:\n# 1 2 3\n# 2 4 6\n# 3 6 9<\/pre><p>Avoid excessive nesting to maintain readability.<\/p><h5><strong>Loops with Blocks<\/strong><\/h5><p><code>loop do<\/code> pairs well with Ruby\u2019s block syntax for custom iterators:<\/p><pre>ruby\ndef custom_iterator(max)\n    i = 0\n    loop do\n        break if i &gt;= max\n        yield i\n        i += 1\n    end\nend\ncustom_iterator(3) { |n| puts n } # Output: 0, 1, 2<\/pre><h5><strong>Error Handling<\/strong><\/h5><p>Handle exceptions within loops to ensure robustness:<\/p><pre>ruby\nattempts = 0\nloop do\n    begin\n        attempts += 1\n        raise \"Error!\" if attempts == 2\n        puts \"Attempt #{attempts}\"\n        break if attempts &gt;= 3\n    rescue\n        puts \"Caught an error, retrying...\"\n    end\nend\n# Output: Attempt 1, Caught an error, retrying..., Attempt 3<\/pre><h3><strong>Loops in Ruby\u2019s Ecosystem<\/strong><\/h3><p>In Ruby on Rails, loops are common for rendering views or processing database records:<\/p><pre>ruby\n# In a Rails view (ERB)\n&lt;% @users.each do |user| %&gt;\n    &lt;p&gt;&lt;%= user.name %&gt;&lt;\/p&gt;\n&lt;% end %&gt;<\/pre><p>When using ActiveRecord, loops iterate over query results:<\/p><pre>ruby\nUser.where(active: true).each do |user|\n    puts user.email\nend<\/pre><h3><strong>Testing Loops<\/strong><\/h3><p>When writing tests (e.g., with RSpec), ensure loops handle edge cases:<\/p><pre>ruby\ndescribe \"sum_array\" do\n    it \"sums an array\" do\n        numbers = [1, 2, 3]\n        sum = 0\n        for num in numbers\n            sum += num\n        end\n        expect(sum).to eq(6)\n    end\n\n    it \"handles empty arrays\" do\n        numbers = []\n        sum = 0\n        for num in numbers\n            sum += num\n        end\n        expect(sum).to eq(0)\n    end\nend<\/pre><h2><strong>Conclusione<\/strong><\/h2><p>Ruby's <code>for, while, until<\/code>, E <code>loop do<\/code> provide versatile tools for controlling program flow. While <code>per<\/code> is great for simple iterations, <code>while<\/code> E <code>until<\/code> excel in condition-driven tasks, and <code>loop do<\/code> offers unmatched flexibility for complex scenarios. However, Ruby\u2019s enumerable methods like <code>ciascuno<\/code> often replace traditional loops for cleaner, more idiomatic code. By mastering these constructs and their control statements (<code>break, next, redo<\/code>), you can write robust, readable, and efficient Ruby programs.<\/p><p>A <a href=\"https:\/\/www.railscarma.com\/it\/\">RailsCarma<\/a>, our <a href=\"https:\/\/www.railscarma.com\/it\/assumere-ruby-on-rails-sviluppatore\/\">Sviluppatori di Ruby on rails<\/a> leverage these techniques to build scalable, maintainable solutions tailored to modern development needs.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t  <div class=\"related-post slider\">\r\n        <div class=\"headline\">Articoli correlati<\/div>\r\n    <div class=\"post-list owl-carousel\">\r\n\r\n            <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Ruby Regex Match Guide (2026) with Examples\" href=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-regex-match-guide-with-examples\/?related_post_from=41249\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/04\/Ruby-Regex-Match-Guide-with-Examples.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Ruby Regex Match\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/04\/Ruby-Regex-Match-Guide-with-Examples.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/04\/Ruby-Regex-Match-Guide-with-Examples-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/04\/Ruby-Regex-Match-Guide-with-Examples-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/04\/Ruby-Regex-Match-Guide-with-Examples-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Ruby Regex Match Guide (2026) with Examples\" href=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-regex-match-guide-with-examples\/?related_post_from=41249\">\r\n        Ruby Regex Match Guide (2026) with Examples  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Giunzioni in Rails: Guida completa all&#039;interfaccia di interrogazione dei record attivi\" href=\"https:\/\/www.railscarma.com\/it\/blog\/rails-joins-una-guida-completa-allinterfaccia-di-interrogazione-dei-record-attivi\/?related_post_from=41226\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Rails-Joins-A-Complete-Guide-to-Active-Record-Query-Interface.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Giunti Rails\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Rails-Joins-A-Complete-Guide-to-Active-Record-Query-Interface.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Rails-Joins-A-Complete-Guide-to-Active-Record-Query-Interface-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Rails-Joins-A-Complete-Guide-to-Active-Record-Query-Interface-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Rails-Joins-A-Complete-Guide-to-Active-Record-Query-Interface-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Giunzioni in Rails: Guida completa all&#039;interfaccia di interrogazione dei record attivi\" href=\"https:\/\/www.railscarma.com\/it\/blog\/rails-joins-una-guida-completa-allinterfaccia-di-interrogazione-dei-record-attivi\/?related_post_from=41226\">\r\n        Giunzioni in Rails: Guida completa all'interfaccia di interrogazione dei record attivi  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Padroneggiare le stringhe multilinea in Ruby: Una guida completa\" href=\"https:\/\/www.railscarma.com\/it\/blog\/mastering-ruby-multiline-strings-a-comprehensive-guide\/?related_post_from=41214\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Mastering-Multiline-Strings-in-Ruby-A-Comprehensive-Guide.png\" class=\"attachment-full size-full wp-post-image\" alt=\"stringa multilinea in rubino\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Mastering-Multiline-Strings-in-Ruby-A-Comprehensive-Guide.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Mastering-Multiline-Strings-in-Ruby-A-Comprehensive-Guide-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Mastering-Multiline-Strings-in-Ruby-A-Comprehensive-Guide-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Mastering-Multiline-Strings-in-Ruby-A-Comprehensive-Guide-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Padroneggiare le stringhe multilinea in Ruby: Una guida completa\" href=\"https:\/\/www.railscarma.com\/it\/blog\/mastering-ruby-multiline-strings-a-comprehensive-guide\/?related_post_from=41214\">\r\n        Padroneggiare le stringhe multilinea in Ruby: Una guida completa  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Commenti multilinea in Ruby spiegati con esempi\" href=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-multiline-comments-explained-with-examples\/?related_post_from=41195\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Ruby-Multiline-Comments-Explained-with-Examples.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Commenti multilinea in rubino\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Ruby-Multiline-Comments-Explained-with-Examples.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Ruby-Multiline-Comments-Explained-with-Examples-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Ruby-Multiline-Comments-Explained-with-Examples-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/03\/Ruby-Multiline-Comments-Explained-with-Examples-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Commenti multilinea in Ruby spiegati con esempi\" href=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-multiline-comments-explained-with-examples\/?related_post_from=41195\">\r\n        Commenti multilinea in Ruby spiegati con esempi  <\/a>\r\n\r\n        <\/div>\r\n      \r\n  <\/div>\r\n\r\n  <script>\r\n      <\/script>\r\n  <style>\r\n    .related-post {}\r\n\r\n    .related-post .post-list {\r\n      text-align: left;\r\n          }\r\n\r\n    .related-post .post-list .item {\r\n      margin: 10px;\r\n      padding: 10px;\r\n          }\r\n\r\n    .related-post .headline {\r\n      font-size: 14px !important;\r\n      color: #999999 !important;\r\n          }\r\n\r\n    .related-post .post-list .item .post_thumb {\r\n      max-height: 220px;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n          }\r\n\r\n    .related-post .post-list .item .post_title {\r\n      font-size: 14px;\r\n      color: #000000;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n      text-decoration: none;\r\n          }\r\n\r\n    .related-post .post-list .item .post_excerpt {\r\n      font-size: 12px;\r\n      color: #3f3f3f;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n      text-decoration: none;\r\n          }\r\n\r\n    .related-post .owl-dots .owl-dot {\r\n          }\r\n\r\n      <\/style>\r\n      <script>\r\n      jQuery(document).ready(function($) {\r\n        $(\".related-post .post-list\").owlCarousel({\r\n          items: 2,\r\n          responsiveClass: true,\r\n          responsive: {\r\n            0: {\r\n              items: 1,\r\n            },\r\n            768: {\r\n              items: 2,\r\n            },\r\n            1200: {\r\n              items: 2,\r\n            }\r\n          },\r\n                      rewind: true,\r\n                                loop: true,\r\n                                center: false,\r\n                                autoplay: true,\r\n            autoplayHoverPause: true,\r\n                                nav: true,\r\n            navSpeed: 1000,\r\n            navText: ['<i class=\"fas fa-chevron-left\"><\/i>', '<i class=\"fas fa-chevron-right\"><\/i>'],\r\n                                dots: false,\r\n            dotsSpeed: 1200,\r\n                                                    rtl: false,\r\n          \r\n        });\r\n      });\r\n    <\/script>\r\n  <\/div>","protected":false},"excerpt":{"rendered":"<p>Ruby, un linguaggio di programmazione dinamico ed espressivo, \u00e8 famoso per la sua semplicit\u00e0 e per la sintassi facile da usare per gli sviluppatori. Una delle sue caratteristiche principali per il controllo del flusso del programma sono i loop, che consentono agli sviluppatori di eseguire ripetutamente il codice in base a condizioni o iterazioni. In Ruby, i principali costrutti di loop sono for, while, until e loop do. Ognuno di essi serve a scopi diversi, ...<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-multiline-comments-explained-with-examples\/\"> <span class=\"screen-reader-text\">Commenti multilinea in Ruby spiegati con esempi<\/span> Leggi altro \"<\/a><\/p>","protected":false},"author":11,"featured_media":39738,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1224],"tags":[],"class_list":["post-39701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ruby Loops Explained: Mastering for, while, until, and loop do - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development<\/title>\n<meta name=\"description\" content=\"Master Ruby loops with this guide covering for, while, until, and loop do\u2014write cleaner, efficient, and more readable Ruby code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby Loops Explained: Mastering for, while, until, and loop do - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\" \/>\n<meta property=\"og:description\" content=\"Master Ruby loops with this guide covering for, while, until, and loop do\u2014write cleaner, efficient, and more readable Ruby code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.railscarma.com\/it\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\" \/>\n<meta property=\"og:site_name\" content=\"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RailsCarma\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-11T09:45:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-12T04:51:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ashish\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@railscarma\" \/>\n<meta name=\"twitter:site\" content=\"@railscarma\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"ashish\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\"},\"author\":{\"name\":\"ashish\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a\"},\"headline\":\"Ruby Loops Explained: Mastering for, while, until, and loop do\",\"datePublished\":\"2025-07-11T09:45:12+00:00\",\"dateModified\":\"2025-07-12T04:51:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\"},\"wordCount\":1039,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.railscarma.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png\",\"articleSection\":[\"Blogs\"],\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\",\"url\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\",\"name\":\"Ruby Loops Explained: Mastering for, while, until, and loop do - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\",\"isPartOf\":{\"@id\":\"https:\/\/www.railscarma.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png\",\"datePublished\":\"2025-07-11T09:45:12+00:00\",\"dateModified\":\"2025-07-12T04:51:03+00:00\",\"description\":\"Master Ruby loops with this guide covering for, while, until, and loop do\u2014write cleaner, efficient, and more readable Ruby code.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage\",\"url\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png\",\"contentUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png\",\"width\":800,\"height\":300,\"caption\":\"Ruby Loops\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.railscarma.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby Loops Explained: Mastering for, while, until, and loop do\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.railscarma.com\/#website\",\"url\":\"https:\/\/www.railscarma.com\/\",\"name\":\"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\",\"description\":\"RailsCarma is a Ruby on Rails Development Company in Bangalore. We specialize in Offshore Ruby on Rails Development based out in USA and India. Hire experienced Ruby on Rails developers for the ultimate Web Experience.\",\"publisher\":{\"@id\":\"https:\/\/www.railscarma.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.railscarma.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.railscarma.com\/#organization\",\"name\":\"RailsCarma\",\"url\":\"https:\/\/www.railscarma.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png\",\"contentUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png\",\"width\":200,\"height\":46,\"caption\":\"RailsCarma\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/RailsCarma\/\",\"https:\/\/x.com\/railscarma\",\"https:\/\/www.linkedin.com\/company\/railscarma\/\",\"https:\/\/myspace.com\/railscarma\",\"https:\/\/in.pinterest.com\/railscarma\/\",\"https:\/\/www.youtube.com\/channel\/UCx3Wil-aAnDARuatTEyMdpg\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a\",\"name\":\"ashish\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g\",\"caption\":\"ashish\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ruby Loops Explained: Mastering for, while, until, and loop do - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development","description":"Master Ruby loops with this guide covering for, while, until, and loop do\u2014write cleaner, efficient, and more readable Ruby code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.railscarma.com\/it\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/","og_locale":"it_IT","og_type":"article","og_title":"Ruby Loops Explained: Mastering for, while, until, and loop do - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development","og_description":"Master Ruby loops with this guide covering for, while, until, and loop do\u2014write cleaner, efficient, and more readable Ruby code.","og_url":"https:\/\/www.railscarma.com\/it\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/","og_site_name":"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development","article_publisher":"https:\/\/www.facebook.com\/RailsCarma\/","article_published_time":"2025-07-11T09:45:12+00:00","article_modified_time":"2025-07-12T04:51:03+00:00","og_image":[{"width":800,"height":300,"url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png","type":"image\/png"}],"author":"ashish","twitter_card":"summary_large_image","twitter_creator":"@railscarma","twitter_site":"@railscarma","twitter_misc":{"Scritto da":"ashish","Tempo di lettura stimato":"5 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#article","isPartOf":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/"},"author":{"name":"ashish","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a"},"headline":"Ruby Loops Explained: Mastering for, while, until, and loop do","datePublished":"2025-07-11T09:45:12+00:00","dateModified":"2025-07-12T04:51:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/"},"wordCount":1039,"commentCount":0,"publisher":{"@id":"https:\/\/www.railscarma.com\/#organization"},"image":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage"},"thumbnailUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png","articleSection":["Blogs"],"inLanguage":"it-IT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/","url":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/","name":"Ruby Loops Explained: Mastering for, while, until, and loop do - RailsCarma - Ruby on Rails Development Company specializing in Offshore Development","isPartOf":{"@id":"https:\/\/www.railscarma.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage"},"image":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage"},"thumbnailUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png","datePublished":"2025-07-11T09:45:12+00:00","dateModified":"2025-07-12T04:51:03+00:00","description":"Master Ruby loops with this guide covering for, while, until, and loop do\u2014write cleaner, efficient, and more readable Ruby code.","breadcrumb":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#primaryimage","url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png","contentUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2025\/07\/Ruby-Loops-Explained-Mastering-for-while-until-and-loop-do.png","width":800,"height":300,"caption":"Ruby Loops"},{"@type":"BreadcrumbList","@id":"https:\/\/www.railscarma.com\/blog\/ruby-loops-explained-mastering-for-while-until-and-loop-do\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.railscarma.com\/"},{"@type":"ListItem","position":2,"name":"Ruby Loops Explained: Mastering for, while, until, and loop do"}]},{"@type":"WebSite","@id":"https:\/\/www.railscarma.com\/#website","url":"https:\/\/www.railscarma.com\/","name":"RailsCarma - Societ\u00e0 di sviluppo Ruby on Rails specializzata nello sviluppo offshore","description":"RailsCarma \u00e8 una societ\u00e0 di sviluppo Ruby on Rails a Bangalore. Siamo specializzati nello sviluppo offshore di Ruby on Rails con sede negli Stati Uniti e in India. Assumi sviluppatori esperti di Ruby on Rails per la migliore esperienza Web.","publisher":{"@id":"https:\/\/www.railscarma.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.railscarma.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/www.railscarma.com\/#organization","name":"RailsCarma","url":"https:\/\/www.railscarma.com\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png","contentUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png","width":200,"height":46,"caption":"RailsCarma"},"image":{"@id":"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RailsCarma\/","https:\/\/x.com\/railscarma","https:\/\/www.linkedin.com\/company\/railscarma\/","https:\/\/myspace.com\/railscarma","https:\/\/in.pinterest.com\/railscarma\/","https:\/\/www.youtube.com\/channel\/UCx3Wil-aAnDARuatTEyMdpg"]},{"@type":"Person","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/9699b14852b308edfeb03096b33c7a7a","name":"ashish","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/204411c7d72714bc32d5ac6398e0596896318386bd537860fdd14ce905a79e07?s=96&d=mm&r=g","caption":"ashish"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/posts\/39701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/comments?post=39701"}],"version-history":[{"count":0,"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/posts\/39701\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/media\/39738"}],"wp:attachment":[{"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/media?parent=39701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/categories?post=39701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.railscarma.com\/it\/wp-json\/wp\/v2\/tags?post=39701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}