module Rouge::HasModes
def get_mode(mode)
def get_mode(mode) return self if self.mode == mode new_name = "#{self.name}.#{mode}" Class.new(self) { name(new_name); mode!(mode) } end
def mode(arg=:absent)
def mode(arg=:absent) return @mode if arg == :absent @modes ||= {} @modes[arg] ||= get_mode(arg) end
def mode!(arg)
def mode!(arg) @mode = arg send("make_#{arg}!") end