Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created September 18, 2019 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmaddox/aaf7e7a82fe3057c33fe29f2af1bc6a2 to your computer and use it in GitHub Desktop.
Save patmaddox/aaf7e7a82fe3057c33fe29f2af1bc6a2 to your computer and use it in GitHub Desktop.
SOLID in Ruby is fluid
class Foo1
def foo
puts "hello foo"
end
end
module FooModule
def foo
puts "hello foo"
end
end
class Foo2
include FooModule
end
require 'forwardable'
class DoFoo
def foo
puts "hello foo"
end
end
class Foo3
extend Forwardable
def_delegator :@foo, :foo
def initialize
@foo = DoFoo.new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment