module Formol class Config < Struct.new(:user_class, :current_user_helper_method, :formatter, :email_from, :text_formatter, :default_avatar, :default_pygment_theme) def user @user ||= user_class.constantize end def default_avatar @default_avatar || 'formol/default_avatar.png' end def default_pygment_theme @default_pygment_theme || :pastie end def default_pygment_theme=(theme) raise "pygments theme '#{theme}' does not exists. Please provide one of the following list:\n#{Formol.pygment_stylesheets.join(', ')}" unless Formol.pygment_stylesheets.include?(theme.to_sym) @default_pygment_theme = theme end end end