Sha256: 4a785b4c3d6b0153d852dee768543ba93c9b6a5459a1f3879a914dbbfa8aedd9

Contents?: true

Size: 683 Bytes

Versions: 6

Compression:

Stored size: 683 Bytes

Contents

module Compass
  module Fontcustom

    # A simple configuration store like the one known from ActiveSupport.
    module Configurable

      def self.included(base)
        base.extend ClassMethods
      end

      module ClassMethods
        def configure(&block)
          yield config
        end

        def config
          @_config ||= Configuration.new
        end
      end

      class Configuration
        def method_missing(meth, *args)
          @config ||= {}
          if meth.to_s =~ /=$/
            sym = meth.to_s[0...-1].to_sym
            @config[sym] = args.first
          else
            @config[meth]
          end
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
compass-fontcustom-1.3.1 lib/compass/fontcustom/configurable.rb
compass-fontcustom-1.3.0 lib/compass/fontcustom/configurable.rb
compass-fontcustom-1.2.0 lib/compass/fontcustom/configurable.rb
compass-fontcustom-1.1.0 lib/compass/fontcustom/configurable.rb
compass-fontcustom-1.0.0 lib/compass/fontcustom/configurable.rb
compass-fontcustom-1.0.0.pre3 lib/compass/fontcustom/configurable.rb