{"id":211850,"date":"2025-03-28T06:14:29","date_gmt":"2025-03-28T06:14:29","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/"},"modified":"2025-03-28T06:14:29","modified_gmt":"2025-03-28T06:14:29","slug":"does-puts-return-a-value-in-ruby","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/","title":{"rendered":"Does puts return a value in Ruby?"},"content":{"rendered":"<p>Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value will be nil. This is different from the print method, which does return the value that was printed.<\/p>\n<p>When writing code in Ruby, it is important to understand how different methods work and what their return values are. In this article, we will explore the question of whether puts returns a value in Ruby and provide answers to other related questions.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#What_is_puts_in_Ruby\" title=\"What is puts in Ruby?\">What is puts in Ruby?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#How_does_puts_differ_from_print_in_Ruby\" title=\"How does puts differ from print in Ruby?\">How does puts differ from print in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#What_does_puts_return_in_Ruby\" title=\"What does puts return in Ruby?\">What does puts return in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#Can_puts_be_used_in_expressions_in_Ruby\" title=\"Can puts be used in expressions in Ruby?\">Can puts be used in expressions in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#Is_it_necessary_to_use_puts_to_print_in_Ruby\" title=\"Is it necessary to use puts to print in Ruby?\">Is it necessary to use puts to print in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#Can_the_return_value_of_puts_be_stored_in_a_variable_in_Ruby\" title=\"Can the return value of puts be stored in a variable in Ruby?\">Can the return value of puts be stored in a variable in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#How_can_I_suppress_the_return_value_of_puts_in_Ruby\" title=\"How can I suppress the return value of puts in Ruby?\">How can I suppress the return value of puts in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#What_happens_if_I_use_puts_with_multiple_arguments_in_Ruby\" title=\"What happens if I use puts with multiple arguments in Ruby?\">What happens if I use puts with multiple arguments in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#Can_I_use_puts_within_a_method_in_Ruby\" title=\"Can I use puts within a method in Ruby?\">Can I use puts within a method in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#Is_puts_commonly_used_in_Ruby_programming\" title=\"Is puts commonly used in Ruby programming?\">Is puts commonly used in Ruby programming?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#What_are_some_alternative_methods_to_puts_in_Ruby\" title=\"What are some alternative methods to puts in Ruby?\">What are some alternative methods to puts in Ruby?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#Can_puts_be_used_with_formatting_options_in_Ruby\" title=\"Can puts be used with formatting options in Ruby?\">Can puts be used with formatting options in Ruby?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_is_puts_in_Ruby\"><\/span>What is puts in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In Ruby, puts is a method that is used to print something to the console. It stands for &#8220;put string&#8221; and is commonly used for outputting messages or variables to the terminal.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_does_puts_differ_from_print_in_Ruby\"><\/span>How does puts differ from print in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The main difference between puts and print in Ruby is that puts adds a newline character at the end of the output, while print does not. This means that puts will move the cursor to the next line after printing, whereas print will keep it on the same line.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_does_puts_return_in_Ruby\"><\/span>What does puts return in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>As mentioned earlier, puts always returns nil in Ruby. This is important to keep in mind when using puts in your code, especially if you are thinking of using the return value for some purpose.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_puts_be_used_in_expressions_in_Ruby\"><\/span>Can puts be used in expressions in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, puts can be used in expressions in Ruby, but you should be aware that the return value will always be nil. If you need to use the return value of a method, you may want to use print instead of puts.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_necessary_to_use_puts_to_print_in_Ruby\"><\/span>Is it necessary to use puts to print in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No, it is not necessary to use puts to print in Ruby. You can also use the print method or use string interpolation to achieve the same result. It ultimately depends on what you are trying to accomplish in your code.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_the_return_value_of_puts_be_stored_in_a_variable_in_Ruby\"><\/span>Can the return value of puts be stored in a variable in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Since puts always returns nil in Ruby, there is no need to store its return value in a variable. If you need to capture the output of a method, you may want to use a different method that returns the desired value.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_can_I_suppress_the_return_value_of_puts_in_Ruby\"><\/span>How can I suppress the return value of puts in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you want to prevent the return value of puts from being displayed or stored, you can add a semicolon at the end of the puts statement. This will suppress the return value and only display the output.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_happens_if_I_use_puts_with_multiple_arguments_in_Ruby\"><\/span>What happens if I use puts with multiple arguments in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When you use puts with multiple arguments in Ruby, each argument will be printed on a separate line. This is because puts automatically adds a newline character at the end of each output.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_use_puts_within_a_method_in_Ruby\"><\/span>Can I use puts within a method in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, you can use puts within a method in Ruby to output messages or variables to the console. Just like using puts outside of a method, the return value of puts within a method will be nil.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_puts_commonly_used_in_Ruby_programming\"><\/span>Is puts commonly used in Ruby programming?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, puts is commonly used in Ruby programming for debugging purposes or for displaying information to the user. It is a simple and effective way to output messages to the console.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_are_some_alternative_methods_to_puts_in_Ruby\"><\/span>What are some alternative methods to puts in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Some alternative methods to puts in Ruby include print, p, and string interpolation. Each of these methods has its own use cases and can be helpful in different situations.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_puts_be_used_with_formatting_options_in_Ruby\"><\/span>Can puts be used with formatting options in Ruby?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, puts can be used with formatting options in Ruby, such as using the % operator or the String#% method. This allows you to format the output in a specific way before printing it to the console.<\/p>\n<p>In conclusion, while puts does return a value in Ruby, it always returns nil. Understanding how puts works and its return value is essential when working with output statements in your Ruby code. Knowing the distinctions between puts and other methods like print can help you choose the right tool for the job and improve your overall coding efficiency.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value will be nil. This is different from the print method, which does return the value that was printed. When writing code in Ruby, it is important &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Does puts return a value in Ruby?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#more-211850\">Read more<span class=\"screen-reader-text\">Does puts return a value in Ruby?<\/span><\/a><\/p>\n","protected":false},"author":53,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-211850","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Does puts return a value in Ruby?<\/title>\n<meta name=\"description\" content=\"Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Does puts return a value in Ruby?\" \/>\n<meta property=\"og:description\" content=\"Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-28T06:14:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Chelsea Hooper\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chelsea Hooper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\"},\"author\":{\"name\":\"Chelsea Hooper\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b\"},\"headline\":\"Does puts return a value in Ruby?\",\"datePublished\":\"2025-03-28T06:14:29+00:00\",\"dateModified\":\"2025-03-28T06:14:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\"},\"wordCount\":707,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\",\"name\":\"Does puts return a value in Ruby?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2025-03-28T06:14:29+00:00\",\"dateModified\":\"2025-03-28T06:14:29+00:00\",\"description\":\"Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Does puts return a value in Ruby?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b\",\"name\":\"Chelsea Hooper\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Chelsea Hooper\"},\"description\":\"Guest author Chelsea Hooper has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Does puts return a value in Ruby?","description":"Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value","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:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/","og_locale":"en_US","og_type":"article","og_title":"Does puts return a value in Ruby?","og_description":"Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value","og_url":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2025-03-28T06:14:29+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png","type":"image\/png"}],"author":"Chelsea Hooper","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Chelsea Hooper","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/"},"author":{"name":"Chelsea Hooper","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b"},"headline":"Does puts return a value in Ruby?","datePublished":"2025-03-28T06:14:29+00:00","dateModified":"2025-03-28T06:14:29+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/"},"wordCount":707,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/","url":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/","name":"Does puts return a value in Ruby?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2025-03-28T06:14:29+00:00","dateModified":"2025-03-28T06:14:29+00:00","description":"Yes, puts does return a value in Ruby, but it always returns nil. This means that when you use puts to output something to the console, the return value","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/does-puts-return-a-value-in-ruby\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"Does puts return a value in Ruby?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b","name":"Chelsea Hooper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Chelsea Hooper"},"description":"Guest author Chelsea Hooper has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/211850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=211850"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/211850\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=211850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=211850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=211850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}