パンくず
Ruby Cookbook
Mixing in Class Methods
概要
Mixing in Class Methods
サンプルコード
# encoding: Windows-31J module Hogeable module HogeClassMethods def hoge puts "hoge!" end end def self.included(receiver) receiver.extend(HogeClassMethods) end end class Hoge include Hogeable end Hoge.hoge
出力
hoge!