Skip to content

Instantly share code, notes, and snippets.

@zakgrant
Created April 3, 2012 20:08
Show Gist options
  • Save zakgrant/2295190 to your computer and use it in GitHub Desktop.
Save zakgrant/2295190 to your computer and use it in GitHub Desktop.
Example of chaining module instance methods
#! /usr/bin/env ruby
module A
def say_hello name
puts "Hello #{name}"
end
end
class B
include A
def say_hello name
super
end
end
b = B.new
b.say_hello "GitHub"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment