Skip to content

Instantly share code, notes, and snippets.

View MarcGrimme's full-sized avatar

Marc Grimme MarcGrimme

View GitHub Profile
@errinlarsen
errinlarsen / simple_delegator_tip.md
Last active December 28, 2015 16:29
Quick tip regarding Ruby's SimpleDelegator

SimpleDelegator

The documentation for SimpleDelegator in the Ruby Standard Library does not describe the most basic usage of SimpleDelegator: simply sub-classing it directly.

class Dog
  attr_accessor :message

  def initialize(message="Bark, bark!")
    @message = message
 end