<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Burdette Lamar</title>
    <description>The latest articles on DEV Community by Burdette Lamar (@burdettelamar).</description>
    <link>https://dev.to/burdettelamar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F35233%2F0af8e087-1bff-4436-867b-abd6c87abf4d.JPG</url>
      <title>DEV Community: Burdette Lamar</title>
      <link>https://dev.to/burdettelamar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/burdettelamar"/>
    <language>en</language>
    <item>
      <title>Fuzzy Fragment Matching</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Thu, 19 Feb 2026 14:28:02 +0000</pubDate>
      <link>https://dev.to/burdettelamar/fuzzy-fragment-matching-1o5g</link>
      <guid>https://dev.to/burdettelamar/fuzzy-fragment-matching-1o5g</guid>
      <description>&lt;p&gt;I posted a &lt;a href="https://stackoverflow.com/questions/79886828/browsers-fuzzy-matching-url-fragments" rel="noopener noreferrer"&gt;question&lt;/a&gt; over at StackOverflow:&lt;/p&gt;

&lt;p&gt;Got one flame (of course).  But also got a wonderful &lt;a href="https://stackoverflow.com/questions/79886828/browsers-fuzzy-matching-url-fragments/79888003#79888003" rel="noopener noreferrer"&gt;answer&lt;/a&gt; from C3roe, about Javascript on GitHub web pages that does fragment matching.&lt;/p&gt;

&lt;p&gt;Does anyone here know how this works, or what matching we can expect?&lt;/p&gt;

</description>
      <category>github</category>
      <category>discuss</category>
      <category>help</category>
    </item>
    <item>
      <title>Quick Access to Ruby Documentation</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Mon, 16 Jun 2025 19:50:14 +0000</pubDate>
      <link>https://dev.to/burdettelamar/quick-access-to-ruby-documentation-50he</link>
      <guid>https://dev.to/burdettelamar/quick-access-to-ruby-documentation-50he</guid>
      <description>&lt;p&gt;&lt;strong&gt;Dev of the Past&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Needs to look up something in the Ruby docs (say, the official doc for class Array).&lt;/li&gt;
&lt;li&gt; Goes to browser window.&lt;/li&gt;
&lt;li&gt; Goes to search engine.&lt;/li&gt;
&lt;li&gt; Searches for &lt;code&gt;Ruby Array&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; Gets annoying and useless suggestions, such as:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Class: Array (Ruby 3.1.0)&lt;/code&gt; (Out-of-date; also not Ruby official doc site).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Class: Array (Ruby 2.7.2)&lt;/code&gt; (Even more out of date; also not official site).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Arrays - Ruby for Beginners&lt;/code&gt; (Not!).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ruby Array 101: Primary Methods &amp;amp; How To Use Them&lt;/code&gt;(Even more Not!)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; Gives up.&lt;/li&gt;
&lt;li&gt; Navigates to the official site &lt;code&gt;https://docs.ruby-lang.org&lt;/code&gt;.

&lt;ol&gt;
&lt;li&gt; Clicks on a language (English or Japanese).&lt;/li&gt;
&lt;li&gt; Clicks &lt;code&gt;master&lt;/code&gt; (or whatever release desired).&lt;/li&gt;
&lt;li&gt; Clicks &lt;code&gt;Classes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; Scrolls to (or searches for ) &lt;code&gt;Array&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; Clicks on it.&lt;/li&gt;
&lt;li&gt; Success!&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Dev of the Future&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(Wisely has gem &lt;code&gt;webri&lt;/code&gt; installed.)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Goes to command window:&lt;/li&gt;
&lt;li&gt;Types:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ webri
webri&amp;gt; Array
Found one class/module name starting with 'Array'
  Array (Array.html)
Opening web page https://docs.ruby-lang.org/en/3.4/Array.html.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Web page magically opens in browser.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;More&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;webri&lt;/code&gt; displays documentation for (details at the links):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#class-or-module" rel="noopener noreferrer"&gt;Class or module&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#singleton-method" rel="noopener noreferrer"&gt;Singleton method&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#instance-method" rel="noopener noreferrer"&gt;Instance method&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#ruby-page" rel="noopener noreferrer"&gt;Ruby page&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#webri---quick-access-to-ruby-online-documentation" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To install:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then invoke with:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Note: tested on Ubuntu and Windows 11.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>documentation</category>
    </item>
    <item>
      <title>New Ruby Gem: webri</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Sat, 14 Jun 2025 00:07:57 +0000</pubDate>
      <link>https://dev.to/burdettelamar/new-ruby-gem-webri-c7n</link>
      <guid>https://dev.to/burdettelamar/new-ruby-gem-webri-c7n</guid>
      <description>&lt;p&gt;I've published a new Ruby gem &lt;code&gt;webri&lt;/code&gt; that is a command-line utility for displaying Ruby's online documentation (web pages).&lt;/p&gt;

&lt;p&gt;It's sort of like RDoc's own &lt;a href="https://ruby.github.io/rdoc/RI_md.html" rel="noopener noreferrer"&gt;RI&lt;/a&gt;, but:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ri&lt;/code&gt; displays &lt;em&gt;text documentation&lt;/em&gt; in your command window.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;webri&lt;/code&gt; displays a  &lt;em&gt;web page&lt;/em&gt; from &lt;a href="https://docs.ruby-lang.org/en/master/table_of_contents.html#pages" rel="noopener noreferrer"&gt;Ruby's official documentation&lt;/a&gt; by opening it in your default web browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example (opens page &lt;a href="https://docs.ruby-lang.org/en/3.4/Array.html" rel="noopener noreferrer"&gt;Array&lt;/a&gt; in your web browser):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ webri
webri&amp;gt; Array
Found one class/module name starting with 'Array'
  Array (Array.html)
Opening web page https://docs.ruby-lang.org/en/3.4/Array.html.
webri&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;webri&lt;/code&gt; displays documentation for (details at the links):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#class-or-module" rel="noopener noreferrer"&gt;Class or module&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#singleton-method" rel="noopener noreferrer"&gt;Singleton method&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#instance-method" rel="noopener noreferrer"&gt;Instance method&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#ruby-page" rel="noopener noreferrer"&gt;Ruby page&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/BurdetteLamar/webri?tab=readme-ov-file#webri" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To install:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then invoke with:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Note: tested on Ubuntu and Windows 11.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Thanks!</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Mon, 24 Mar 2025 21:49:58 +0000</pubDate>
      <link>https://dev.to/burdettelamar/thanks-p8a</link>
      <guid>https://dev.to/burdettelamar/thanks-p8a</guid>
      <description>&lt;p&gt;To borrow a thought from Post Benedict XVI, I don't know how much more time and strength I'll have, so should say now what I have to say.&lt;/p&gt;

&lt;p&gt;I worked for forty years in the software industry:  as a documentor, a developer, and a test-automation specialist.  Most of that work mattered at the time;  some was leading-edge (sometimes, bleeding-edge).  Now all that work is dead and gone -- and that's okay;  that's the way of all software.&lt;/p&gt;

&lt;p&gt;When I "got retired," I first tried working on some projects of my own, blogging, and posting to some tech sites.  That work was low-impact to begin with, and rapidly became much lower-impact.  I was amazed at how quickly the search engines forgot about me (think, "red shift").&lt;/p&gt;

&lt;p&gt;Then I realized that I should be working to improve the documentation for the Ruby core and Standard Library -- which will not be forgotten anytime soon.  So for five years now, I've been doing that.&lt;/p&gt;

&lt;p&gt;Profuse thanks to everyone who has helped me along the way.  I'm not going to try to name the many careful reviewers who have kept me on the straight and narrow in this work;  if I tried to do so, I would surely mistakenly leave out someone I should have included.&lt;/p&gt;

&lt;p&gt;Those who study longevity say that a sense of purpose is crucial to well-being.  My purpose in this work has made my life interesting and pleasant, and I'm sure has also made it longer.  So once again, Thanks!&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>ruby</category>
      <category>career</category>
    </item>
    <item>
      <title>Nokogiri Cookbook?</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Wed, 22 Jan 2025 23:00:27 +0000</pubDate>
      <link>https://dev.to/burdettelamar/nokogiri-cookbook-4p1d</link>
      <guid>https://dev.to/burdettelamar/nokogiri-cookbook-4p1d</guid>
      <description>&lt;p&gt;Rubyists! We're planning to write up some "how-to" docs for &lt;a href="https://github.com/sparklemotion/nokogiri" rel="noopener noreferrer"&gt;Nokogiri&lt;/a&gt; (the Ruby gem for XML/HTML). What are things you frequently do with XML or HTML, or wish there was a short recipe for?&lt;/p&gt;

&lt;p&gt;Tell us here: &lt;a href="https://github.com/sparklemotion/nokogiri/discussions/3419" rel="noopener noreferrer"&gt;https://github.com/sparklemotion/nokogiri/discussions/3419&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Or, if you can't post a reply there, tell us here.)&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>html</category>
      <category>xml</category>
    </item>
    <item>
      <title>My First RubyConf</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Tue, 19 Nov 2024 10:32:46 +0000</pubDate>
      <link>https://dev.to/burdettelamar/my-first-rubyconf-2ik4</link>
      <guid>https://dev.to/burdettelamar/my-first-rubyconf-2ik4</guid>
      <description>&lt;p&gt;&lt;b&gt;TL;DR&lt;/b&gt;:  Went to &lt;a href="https://rubyconf.org/" rel="noopener noreferrer"&gt;RubyConf in Chicago&lt;/a&gt;;  had a wonderful time;  met "online" friends;  met new people;  found new work.&lt;/p&gt;

&lt;p&gt;The Ruby community is very welcoming and friendly.  I'd forgotten a main Ruby meme:  "Matz is nice, so we are nice."  (Matz is the Ruby founder and benevolent dictator).&lt;/p&gt;

&lt;p&gt;I could walk up to any group, seated or standing, and ask "May I join you?" and be welcomed.  The custom is to say your name and hold up your credential (to show written name);  others do the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfz7zyfrrgbfvqcr48yl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfz7zyfrrgbfvqcr48yl.jpg" alt="My RubyConf credential" width="640" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The response I'd often get is "You're a core committer!"  (Core committers maintain and extend Ruby;  we are about 75 worldwide, and were 15 of the 600 conference attendees.)&lt;/p&gt;

&lt;p&gt;People wanted to know what I do (I revise and extend Ruby documentation), and generally thanked me for my work  (everyone wants to write code, not many want to write documentation).&lt;/p&gt;

&lt;p&gt;I had some come to me and say "I wanted to meet you," including some of the major players.  This happened more often as the conference went on, which may mean that word was spreading among the &lt;em&gt;cognoscenti&lt;/em&gt; that I was there.  Also, daily red shirt and black tie (as also seen on this site) made me easy to find.&lt;/p&gt;

&lt;p&gt;I met some of the people who have spent countless hours reviewing what I write (and gently pointing out my worst blunders).  Also made a point to meet Matz (would not be allowed to return home otherwise), and several committers whose work I may be able to help with.&lt;/p&gt;

&lt;p&gt;The attendees were from everywhere:  North America, Japan, Brazil, Poland, Bosnia, Kenya, and more.&lt;/p&gt;

&lt;p&gt;I myself took only one picture (many others will be available later):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpmc0zy15kncvfn0jsty.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpmc0zy15kncvfn0jsty.jpg" alt="Informal group picture" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Travel was easy, room was comfortable.  Only gained 4 pounds (major victory!).&lt;/p&gt;

&lt;p&gt;Will go next year!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>community</category>
    </item>
    <item>
      <title>Rubyist Survey: Ruby ri documentation viewer</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Sun, 03 Mar 2024 12:51:43 +0000</pubDate>
      <link>https://dev.to/burdettelamar/ruby-ri-documentation-viewer-4l1g</link>
      <guid>https://dev.to/burdettelamar/ruby-ri-documentation-viewer-4l1g</guid>
      <description>&lt;p&gt;Rubyists, how do you use ri? Very often? Sometimes? Occasionally? Rarely? Not at all? Never heard of it?&lt;/p&gt;

&lt;p&gt;Hint: Type ‘ri --help’&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>documentation</category>
      <category>ri</category>
    </item>
    <item>
      <title>RDoc Markup Reference</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Mon, 25 Sep 2023 14:31:22 +0000</pubDate>
      <link>https://dev.to/burdettelamar/rdoc-markup-reference-407h</link>
      <guid>https://dev.to/burdettelamar/rdoc-markup-reference-407h</guid>
      <description>&lt;p&gt;Last year I created a new markup reference for Ruby's RDoc module.  If you're an RDoc user, check it out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.ruby-lang.org/en/master/RDoc/MarkupReference.html" rel="noopener noreferrer"&gt;https://docs.ruby-lang.org/en/master/RDoc/MarkupReference.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ruby</category>
      <category>markup</category>
      <category>documentation</category>
      <category>rdoc</category>
    </item>
    <item>
      <title>What's Here in Ruby Class Hash</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Wed, 19 Jul 2023 19:01:16 +0000</pubDate>
      <link>https://dev.to/burdettelamar/whats-here-in-ruby-class-hash-533h</link>
      <guid>https://dev.to/burdettelamar/whats-here-in-ruby-class-hash-533h</guid>
      <description>&lt;p&gt;Check out the &lt;a href="https://docs.ruby-lang.org/en/master/Hash.html#class-Hash-label-What-27s+Here" rel="noopener noreferrer"&gt;What's Here&lt;/a&gt; section in the documentation for Ruby class Hash.  (Full disclosure: I wrote it.)&lt;/p&gt;

&lt;p&gt;It's not a tutorial; it's an overview of methods by category (creating, comparing, querying, etc.).&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>hash</category>
      <category>rubywhatshere</category>
    </item>
    <item>
      <title>Ruby Method of the Day: String#=~</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Thu, 29 Jun 2023 14:32:25 +0000</pubDate>
      <link>https://dev.to/burdettelamar/ruby-method-of-the-day-string-30f2</link>
      <guid>https://dev.to/burdettelamar/ruby-method-of-the-day-string-30f2</guid>
      <description>&lt;p&gt;Method &lt;a href="https://docs.ruby-lang.org/en/master/String.html#method-i-3D~" rel="noopener noreferrer"&gt;String#=~&lt;/a&gt; searches string &lt;code&gt;self&lt;/code&gt;, looking for the given argument (Regexp or other object).&lt;/p&gt;

&lt;p&gt;When the argument is a regexp, the method returns the integer index of the first substring that matches the regexp, or &lt;code&gt;nil&lt;/code&gt; if no match.&lt;/p&gt;

&lt;p&gt;But that's only the beginning.  The method also sets a number of global variables that give more details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$~&lt;/code&gt;: Returns a &lt;a href="https://docs.ruby-lang.org/en/master/MatchData.html" rel="noopener noreferrer"&gt;MatchData&lt;/a&gt; object, or nil.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&amp;amp;&lt;/code&gt;: Returns the matched part of the string, or nil.&lt;/li&gt;
&lt;li&gt;$`: Returns the part of the string to the left of the match, or nil.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$'&lt;/code&gt;: Returns the part of the string to the right of the match, or nil.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$+&lt;/code&gt;: Returns the last group matched, or nil.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt;, etc.: Returns the first, second, etc., matched group, or nil. Note that &lt;code&gt;$0&lt;/code&gt; is quite different; it returns the name of the currently executing program.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See examples at &lt;a href="https://docs.ruby-lang.org/en/master/Regexp.html#class-Regexp-label-Global+Variables" rel="noopener noreferrer"&gt;Regexp Global Variables&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;[Yes, I've copied shamelessly from the official documentation for regexp global variables.  But I don't feel bad;  I &lt;em&gt;wrote&lt;/em&gt; that documentation (as well as the documentation for &lt;code&gt;String#=~&lt;/code&gt;).]&lt;/p&gt;

&lt;p&gt;More methods at &lt;a href="https://dev.to/t/rubymethodoftheday"&gt;#rubymethodoftheday&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>regularexpression</category>
      <category>string</category>
      <category>rubymethodoftheday</category>
    </item>
    <item>
      <title>Ruby Method of the Day: #count</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Wed, 28 Jun 2023 12:17:07 +0000</pubDate>
      <link>https://dev.to/burdettelamar/ruby-method-of-the-day-count-424c</link>
      <guid>https://dev.to/burdettelamar/ruby-method-of-the-day-count-424c</guid>
      <description>&lt;p&gt;Method &lt;code&gt;count&lt;/code&gt; returns an integer count of the number of items in a collection that match a given criterion.&lt;/p&gt;

&lt;p&gt;The method is available as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.ruby-lang.org/en/master/Array.html#method-i-count" rel="noopener noreferrer"&gt;Array#count&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.ruby-lang.org/en/master/Range.html#method-i-count" rel="noopener noreferrer"&gt;Range#count&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.ruby-lang.org/en/master/String.html#method-i-count" rel="noopener noreferrer"&gt;String#count&lt;/a&gt; (with a special implementation that is not discussed here).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.ruby-lang.org/en/master/Enumerable.html#method-i-count" rel="noopener noreferrer"&gt;Enumerable#count&lt;/a&gt;, which is &lt;a href="https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes" rel="noopener noreferrer"&gt;included or extended&lt;/a&gt; in a number of classes in the Ruby core and standard library.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are three ways to call the method:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With no argument and no block, returns the count of items in the collection:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; 3&lt;/span&gt;
&lt;span class="p"&gt;[].&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; 0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;With argument &lt;code&gt;object&lt;/code&gt;, returns the count of items &lt;code&gt;== object&lt;/code&gt; in the collection:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[0, 1, 2, 0.0].count(0) # =&amp;gt; 2
[0, 1, 2].count(3) # =&amp;gt; 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;With a block, calls the block with each item in the collection; returns the count of elements for which the block returns a truthy value:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[0, 1, 2, 3].count {|element| element &amp;gt; 1} # =&amp;gt; 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More methods at &lt;a href="https://dev.to/t/rubymethodoftheday"&gt;#rubymethodoftheday&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>count</category>
      <category>rubymethodoftheday</category>
    </item>
    <item>
      <title>Ruby Method of the Day: Array.new with Block</title>
      <dc:creator>Burdette Lamar</dc:creator>
      <pubDate>Tue, 27 Jun 2023 20:47:55 +0000</pubDate>
      <link>https://dev.to/burdettelamar/ruby-method-of-the-day-arraynew-with-block-3mj5</link>
      <guid>https://dev.to/burdettelamar/ruby-method-of-the-day-arraynew-with-block-3mj5</guid>
      <description>&lt;p&gt;One of the call sequences for method &lt;a href="https://docs.ruby-lang.org/en/master/Array.html#method-c-new" rel="noopener noreferrer"&gt;Array.new&lt;/a&gt;  takes a block, allowing you to populate the new array with anything you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns an array of the given &lt;code&gt;size&lt;/code&gt;; the block is called with each successive integer &lt;code&gt;index&lt;/code&gt;; the block's return value becomes the element for that index:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = Array.new(3) {|index| "Element #{index}" }
a # =&amp;gt; ["Element 0", "Element 1", "Element 2"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More methods at &lt;a href="https://dev.to/t/rubymethodoftheday"&gt;#rubymethodoftheday&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>array</category>
      <category>rubymethodoftheday</category>
    </item>
  </channel>
</rss>
