Sha256: f34d27f3284c1d657cefef23e15d3afd20103f7297544b9e29eea7517d47686a

Contents?: true

Size: 766 Bytes

Versions: 15

Compression:

Stored size: 766 Bytes

Contents

module Doc
  class RootConfig < ConfigObject
    attr_reader :documentor
    def initialize(documentor, *arguments, &block)
      @documentor = documentor
      super :title, *arguments, &block

      if clean_after
        if !clean_after.is_a?(Numeric)
          raise "clean_after must be a number, got #{clean_after.inspect}"
        elsif clean_after < 0
          raise "clean_after must zero or greater, got #{clean_after.inspect}"
        end
      end
    end

    def configurators
      @configurators ||= []
    end

    def self.configurator(name, klass)
      class_eval <<-RUBY, __FILE__, __LINE__
        def #{name}(*arguments, &block)
          configurators << #{klass}.new(documentor, *arguments, &block)
        end
      RUBY
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
doc-0.5.0 lib/doc/root_config.rb
doc-0.4.1 lib/doc/root_config.rb
doc-0.4.0 lib/doc/root_config.rb
doc-0.3.0 lib/doc/root_config.rb
doc-0.2.8 lib/doc/root_config.rb
doc-0.2.7 lib/doc/root_config.rb
doc-0.2.6 lib/doc/root_config.rb
doc-0.2.5 lib/doc/root_config.rb
doc-0.2.4 lib/doc/root_config.rb
doc-0.2.3 lib/doc/root_config.rb
doc-0.2.2 lib/doc/root_config.rb
doc-0.2.1 lib/doc/root_config.rb
doc-0.2.0 lib/doc/root_config.rb
doc-0.1.0 lib/doc/root_config.rb
doc-0.0.1 lib/doc/root_config.rb