module Rouge::HasModes
Public Instance Methods
Source
# File lib/rouge/theme.rb, line 143 def get_mode(mode) return self if self.mode == mode new_name = "#{self.name}.#{mode}" Class.new(self) { name(new_name); set_mode!(mode) } end
Source
# File lib/rouge/theme.rb, line 136 def mode(arg=:absent) return @mode if arg == :absent @modes ||= {} @modes[arg] ||= get_mode(arg) end
Source
# File lib/rouge/theme.rb, line 155 def mode!(arg) alt_name = "#{self.name}.#{arg}" register(alt_name) set_mode!(arg) end
Source
# File lib/rouge/theme.rb, line 150 def set_mode!(mode) @mode = mode send("make_#{mode}!") end