概要
クラス拡張
内容
クラスの特異クラスにモジュールをインクルードして、クラスメソッドを定義する。
サンプル
# encoding: utf-8 require "pp" class Hoge;end module Hageable def hage puts "hage" end end class << Hoge include Hageable end Hoge.hage
クラス拡張
クラスの特異クラスにモジュールをインクルードして、クラスメソッドを定義する。
# encoding: utf-8 require "pp" class Hoge;end module Hageable def hage puts "hage" end end class << Hoge include Hageable end Hoge.hage