{"id":1615,"date":"2026-09-21T13:33:22","date_gmt":"2026-09-21T12:33:22","guid":{"rendered":"https:\/\/ruby-doc.org\/learn\/?p=1615"},"modified":"2026-09-11T13:50:22","modified_gmt":"2026-09-11T12:50:22","slug":"ruby-programming-language-overview","status":"publish","type":"post","link":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/","title":{"rendered":"Ruby Programming Language Overview: Read a Complete Program"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This Ruby programming language overview follows one small program from input to output. You will meet values, arrays, hashes, methods, blocks and conditions, then change the input to see what breaks. Ruby is a general-purpose, object-oriented language with dynamic typing: objects have types, while ordinary variables do not require declared types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You only need a Ruby installation and a text editor to run the example. No Rails application, database or downloaded gem is involved. If you are reading without a terminal, predict the results before opening the exercises further down the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1536\" height=\"1024\" src=\"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp\" alt=\"Ruby programming language overview illustrated by a faceted ruby surrounded by organised glass objects and connected components\" class=\"wp-image-1609\" srcset=\"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp 1536w, https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured-300x200.webp 300w, https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured-1024x683.webp 1024w, https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured-768x512.webp 768w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><figcaption class=\"wp-element-caption\">A conceptual view of Ruby&#8217;s building blocks; the article&#8217;s code shows their precise behaviour.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Ruby programming language overview: the main pieces<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A value represents something the program can work with. <a href=\"https:\/\/www.bbc.co.uk\/bitesize\/guides\/z788jty\/revision\/1\">A string holds text<\/a>, an integer represents a whole number, and an array keeps an ordered collection of values. A hash associates keys with values. Methods describe operations, while blocks pass a piece of behaviour to another method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These categories become easier to recognise in a real example. A book order can use a string for the title and an integer for the quantity. A hash can hold both under named keys, and an array can hold several book-order records in sequence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Dynamic typing does not eliminate types. The string <code>\"2\"<\/code> and the integer <code>2<\/code> are different objects with different behaviour. When a program expects a quantity, it must decide what to do with incoming text: convert it, reject it or report it for correction.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A complete program to read and run<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Save this code in <code>order_summary.rb<\/code>, then run <code>ruby order_summary.rb<\/code>. The output and nine behaviour checks passed with Ruby 3.2.3. Keep the spelling of the symbol keys consistent: <code>:title<\/code> is not the same key as the string <code>\"title\"<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def order_summary(items)\n  items.map do |item|\n    title = item.fetch(:title)\n    quantity = item.fetch(:quantity)\n\n    unless title.is_a?(String) &amp;&amp; quantity.is_a?(Integer) &amp;&amp; quantity &gt;= 0\n      raise ArgumentError, \"title must be text and quantity a non-negative integer\"\n    end\n\n    label = quantity == 1 ? \"copy\" : \"copies\"\n    \"#{title}: #{quantity} #{label}\"\n  end\nend\n\nitems = &#91;\n  { title: \"Ruby notes\", quantity: 2 },\n  { title: \"Practice book\", quantity: 1 }\n]\n\nputs order_summary(items)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output is <code>Ruby notes: 2 copies<\/code> followed by <code>Practice book: 1 copy<\/code> on the next line. The method creates an array of summary strings. Finally, <code>puts<\/code> prints each string on its own line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Try changing the second quantity to <code>0<\/code>. The record remains valid and its summary says <code>0 copies<\/code>. The rule here allows zero; another application might require at least one. Validation is a choice about the data your program accepts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Methods: inputs, results and names<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>def<\/code> keyword starts a method definition and <code>end<\/code> closes it. In this example, <code>items<\/code> is a parameter: a local name for the argument supplied by the caller. The call at the bottom provides the actual array.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ruby&#8217;s method syntax reference explains that a method normally returns the value of its last evaluated expression. Here that expression is the call to <code>map<\/code>. You do not need an explicit <code>return<\/code> at the bottom to return its array.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep a method&#8217;s returned value separate from what it prints. This method returns data, which makes it useful outside a terminal too. The final call to <code>puts<\/code> handles display. You could later write the returned strings to a file without changing the formatting method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good name helps the next reader find a responsibility. <code>order_summary<\/code> tells you more than <code>process<\/code>. Shortening code by choosing names that hide the work can make it harder to maintain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Arrays, hashes and blocks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The outer square brackets create an array. Each pair of curly braces creates a hash containing a title and a quantity. The <code>fetch<\/code> calls request required keys; if a key is missing, Ruby raises <code>KeyError<\/code> instead of quietly supplying a default value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The block begins with <code>do |item|<\/code>. For each element, <code>map<\/code> runs the block and collects its result in a new array. The last line inside the block builds a string with interpolation: expressions inside <code>#{...}<\/code> contribute their values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The example reads the input records without changing them. That does not mean every call to <code>map<\/code> is free of side effects. A block can still modify objects if you put a modifying operation inside it. Our <a href=\"https:\/\/ruby-doc.org\/learn\/ruby-functional-programming\/\">Ruby functional programming guide<\/a> explores this distinction with additional examples.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conditions and truthiness<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The validation condition combines three checks with <code>&amp;&amp;<\/code>: a string title, an integer quantity and a non-negative value. The <code>unless<\/code> branch raises an exception when that combined condition is false. Since the checks run from left to right and short-circuit, a non-integer quantity does not reach the numeric comparison.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next condition chooses between <code>copy<\/code> and <code>copies<\/code>. The compact conditional operator uses the form <code>condition ? value_if_true : value_if_false<\/code>. A longer decision usually reads better as an ordinary <code>if<\/code> expression.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ruby&#8217;s <a href=\"https:\/\/docs.ruby-lang.org\/en\/3.4\/syntax\/control_expressions_rdoc.html\">control-expression documentation<\/a> makes an important rule explicit: only <code>false<\/code> and <code>nil<\/code> are falsey. Both zero and an empty string are truthy. Therefore, checking whether a quantity exists is different from checking whether it is positive.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Predict the result, then reveal it<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Change one thing at a time. Before running the program, predict whether it will produce normal output, an empty result or an exception.<\/p>\n\n\n\n<details class=\"wp-block-details rdc-disclosure is-layout-flow wp-block-details-is-layout-flow\"><summary>What happens with an empty items array?<\/summary>\n<p class=\"wp-block-paragraph\">The method returns an empty array because there are no elements for the block to transform. The final puts call prints no summary lines. An empty input is valid for this method.<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details rdc-disclosure is-layout-flow wp-block-details-is-layout-flow\"><summary>What happens if quantity becomes the string &#8220;2&#8221;?<\/summary>\n<p class=\"wp-block-paragraph\">The integer check fails, so the method raises ArgumentError. It does not automatically treat numeric-looking text as a valid quantity. Decide on an explicit conversion policy when reading outside input.<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details rdc-disclosure is-layout-flow wp-block-details-is-layout-flow\"><summary>What happens if the quantity key is missing?<\/summary>\n<p class=\"wp-block-paragraph\">The fetch call raises KeyError before the later validation condition runs. Missing data and data of the wrong type are different failures, even if the interface eventually explains both as an invalid record.<\/p>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">Complete your Ruby programming language overview: errors<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The example deliberately stops on invalid input. In a larger application, the calling code could catch an expected error and show a useful message. Avoid rescuing every possible failure just to print success; that can hide programming mistakes as well as bad input.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For practice, add another valid record, remove a required key and supply a negative quantity. Check each case independently. Our <a href=\"https:\/\/ruby-doc.org\/learn\/ruby-code-examples\/\">Ruby code examples<\/a> give you more material once you can explain the path through this program.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You do not need to memorise the entire language before writing something useful. Start by identifying the input, the transformation and the result. Then make the rules for missing or unexpected data visible in the code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow an order-summary program from data to output, then test empty input, incorrect types and missing keys.<\/p>\n","protected":false},"author":3,"featured_media":1609,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-tips"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":7}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ruby Programming Language Overview With Examples<\/title>\n<meta name=\"description\" content=\"A Ruby programming language overview covering values, methods, arrays, hashes, blocks and errors through a complete program and expandable exercises.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby Programming Language Overview With Examples\" \/>\n<meta property=\"og:description\" content=\"A Ruby programming language overview covering values, methods, arrays, hashes, blocks and errors through a complete program and expandable exercises.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/\" \/>\n<meta property=\"og:site_name\" content=\"Ruby-Doc Learn\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-21T12:33:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"James Britt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Britt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/james-britt\\\/#james-britt\"},\"headline\":\"Ruby Programming Language Overview: Read a Complete Program\",\"datePublished\":\"2026-09-21T12:33:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/\"},\"wordCount\":1004,\"publisher\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/ruby-programming-language-overview-featured.webp\",\"articleSection\":[\"Ruby tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/\",\"url\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/\",\"name\":\"Ruby Programming Language Overview With Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/ruby-programming-language-overview-featured.webp\",\"datePublished\":\"2026-09-21T12:33:22+00:00\",\"description\":\"A Ruby programming language overview covering values, methods, arrays, hashes, blocks and errors through a complete program and expandable exercises.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/ruby-programming-language-overview-featured.webp\",\"contentUrl\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/ruby-programming-language-overview-featured.webp\",\"width\":1536,\"height\":1024,\"caption\":\"A conceptual view of Ruby's building blocks; the article's code shows their precise behaviour.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/ruby-programming-language-overview\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby Programming Language Overview: Read a Complete Program\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#website\",\"url\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/\",\"name\":\"Ruby-Doc Learn\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#organization\",\"name\":\"Ruby-Doc Learn\",\"url\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/ruby-doc-logo-transparent.png\",\"contentUrl\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/ruby-doc-logo-transparent.png\",\"width\":1650,\"height\":305,\"caption\":\"Ruby-Doc Learn\"},\"image\":{\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/james-britt\\\/#james-britt\",\"name\":\"James Britt\",\"image\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/jgb_self-portrait-20140914.png\",\"description\":\"Creator and long-term maintainer of Ruby-Doc.org, founder of Neurogami, and author of practical Ruby tutorials for Ruby-Doc Learn.\",\"sameAs\":[\"https:\\\/\\\/jamesbritt.com\\\/\",\"https:\\\/\\\/neurogami.com\\\/\",\"https:\\\/\\\/www.oreilly.com\\\/pub\\\/au\\\/2595\",\"https:\\\/\\\/www.rubyevents.org\\\/profiles\\\/james-britt\"],\"url\":\"https:\\\/\\\/ruby-doc.org\\\/learn\\\/james-britt\\\/\",\"jobTitle\":\"Ruby developer and writer\",\"knowsAbout\":[\"Ruby programming language\",\"Ruby documentation\",\"JRuby\",\"Open Sound Control\",\"Software development\"],\"affiliation\":{\"@type\":\"Organization\",\"name\":\"Ruby-Doc.org\",\"url\":\"https:\\\/\\\/ruby-doc.org\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ruby Programming Language Overview With Examples","description":"A Ruby programming language overview covering values, methods, arrays, hashes, blocks and errors through a complete program and expandable exercises.","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:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/","og_locale":"en_US","og_type":"article","og_title":"Ruby Programming Language Overview With Examples","og_description":"A Ruby programming language overview covering values, methods, arrays, hashes, blocks and errors through a complete program and expandable exercises.","og_url":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/","og_site_name":"Ruby-Doc Learn","article_published_time":"2026-09-21T12:33:22+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp","type":"image\/webp"}],"author":"James Britt","twitter_card":"summary_large_image","twitter_misc":{"Written by":"James Britt","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#article","isPartOf":{"@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/"},"author":{"@id":"https:\/\/ruby-doc.org\/learn\/james-britt\/#james-britt"},"headline":"Ruby Programming Language Overview: Read a Complete Program","datePublished":"2026-09-21T12:33:22+00:00","mainEntityOfPage":{"@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/"},"wordCount":1004,"publisher":{"@id":"https:\/\/ruby-doc.org\/learn\/#organization"},"image":{"@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#primaryimage"},"thumbnailUrl":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp","articleSection":["Ruby tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/","url":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/","name":"Ruby Programming Language Overview With Examples","isPartOf":{"@id":"https:\/\/ruby-doc.org\/learn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#primaryimage"},"image":{"@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#primaryimage"},"thumbnailUrl":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp","datePublished":"2026-09-21T12:33:22+00:00","description":"A Ruby programming language overview covering values, methods, arrays, hashes, blocks and errors through a complete program and expandable exercises.","breadcrumb":{"@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#primaryimage","url":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp","contentUrl":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-programming-language-overview-featured.webp","width":1536,"height":1024,"caption":"A conceptual view of Ruby's building blocks; the article's code shows their precise behaviour."},{"@type":"BreadcrumbList","@id":"https:\/\/ruby-doc.org\/learn\/ruby-programming-language-overview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ruby-doc.org\/learn\/"},{"@type":"ListItem","position":2,"name":"Ruby Programming Language Overview: Read a Complete Program"}]},{"@type":"WebSite","@id":"https:\/\/ruby-doc.org\/learn\/#website","url":"https:\/\/ruby-doc.org\/learn\/","name":"Ruby-Doc Learn","description":"","publisher":{"@id":"https:\/\/ruby-doc.org\/learn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ruby-doc.org\/learn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ruby-doc.org\/learn\/#organization","name":"Ruby-Doc Learn","url":"https:\/\/ruby-doc.org\/learn\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ruby-doc.org\/learn\/#\/schema\/logo\/image\/","url":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-doc-logo-transparent.png","contentUrl":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/ruby-doc-logo-transparent.png","width":1650,"height":305,"caption":"Ruby-Doc Learn"},"image":{"@id":"https:\/\/ruby-doc.org\/learn\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ruby-doc.org\/learn\/james-britt\/#james-britt","name":"James Britt","image":"https:\/\/ruby-doc.org\/learn\/wp-content\/uploads\/2026\/09\/jgb_self-portrait-20140914.png","description":"Creator and long-term maintainer of Ruby-Doc.org, founder of Neurogami, and author of practical Ruby tutorials for Ruby-Doc Learn.","sameAs":["https:\/\/jamesbritt.com\/","https:\/\/neurogami.com\/","https:\/\/www.oreilly.com\/pub\/au\/2595","https:\/\/www.rubyevents.org\/profiles\/james-britt"],"url":"https:\/\/ruby-doc.org\/learn\/james-britt\/","jobTitle":"Ruby developer and writer","knowsAbout":["Ruby programming language","Ruby documentation","JRuby","Open Sound Control","Software development"],"affiliation":{"@type":"Organization","name":"Ruby-Doc.org","url":"https:\/\/ruby-doc.org\/"}}]}},"_links":{"self":[{"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/posts\/1615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/comments?post=1615"}],"version-history":[{"count":1,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/posts\/1615\/revisions"}],"predecessor-version":[{"id":1625,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/posts\/1615\/revisions\/1625"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/media\/1609"}],"wp:attachment":[{"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/media?parent=1615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/categories?post=1615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ruby-doc.org\/learn\/wp-json\/wp\/v2\/tags?post=1615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}