Skip to content

Instantly share code, notes, and snippets.

@nabetama
Created February 15, 2012 16:22
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 nabetama/1837030 to your computer and use it in GitHub Desktop.
Save nabetama/1837030 to your computer and use it in GitHub Desktop.
Test for HatenaBlog
#!/usr/bin/env ruby
# encoding: utf-8
# name space
module Cook; end
# スープに塩を加える
module Cook::Salt
def self.included(klass)
klass.extend(ClassModule)
end
module ClassModule
def add_salt
p "Salt seasons all things."
end
end
end
class Soup
include Cook::Salt
def initialize()
super
end
end
Soup.add_salt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment