require 'impartial/version' module Impartial module Configuration VALID_OPTIONS_KEYS = [ :paths ].freeze # Look for impartial templates in this location DEFAULT_PATHS = ['./impartials'] attr_accessor *VALID_OPTIONS_KEYS # When this module is extended, set all configuration options to their default values def self.extended(base) base.reset end # Convenience method to allow configuration options to be set in a block def configure yield self end # Create a hash of options and their values def options options = {} VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)} options end # Reset all configuration options to defaults def reset self.paths = DEFAULT_PATHS self end end end