<?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: Peter P</title>
    <description>The latest articles on DEV Community by Peter P (@peteonthings).</description>
    <link>https://dev.to/peteonthings</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%2F260198%2F589642f8-d040-45dc-970a-f890a56a178a.png</url>
      <title>DEV Community: Peter P</title>
      <link>https://dev.to/peteonthings</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peteonthings"/>
    <language>en</language>
    <item>
      <title>How to decorate any object in Ruby in 3 lines</title>
      <dc:creator>Peter P</dc:creator>
      <pubDate>Wed, 15 Jan 2020 04:07:28 +0000</pubDate>
      <link>https://dev.to/peteonthings/how-to-decorate-any-object-in-ruby-in-3-lines-kbh</link>
      <guid>https://dev.to/peteonthings/how-to-decorate-any-object-in-ruby-in-3-lines-kbh</guid>
      <description>&lt;p&gt;Here is a quick and easy way to decorate any object instance in Ruby. &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This is useful if you don't know or care the object type you are working with but would like to add accessor methods to just that instance. This is a very pure decorator because adding accessors does not rely on internal knowledge of the object. &lt;/p&gt;

&lt;p&gt;We're just dynamically adding functionality to the instance as we need it. &lt;/p&gt;

&lt;p&gt;NOTE: This could clobber existing functionality, so you want be sure you are decorating it with a method name that won't interfere with the object class. &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>metaprogramming</category>
    </item>
  </channel>
</rss>
