Sha256: c5bedbbbd8f0ab100395a40ab52cbb58f4609c1cb6c5058b4ded53977864207b

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

module TableCloth
  class Configuration
    OPTIONS = %w(table thead th tbody tr td).map(&:to_sym)

    OPTIONS.each do |option|
      class_eval <<-OPTION, __FILE__, __LINE__+1
        def #{option}
          @#{option}_option ||= ActiveSupport::OrderedOptions.new
        end
      OPTION
    end

    class << self
      def configure(&block)
        yield TableCloth.config
      end
    end

    def config_for(type)
      send(type).to_hash
    end
    alias [] config_for
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
table_cloth-0.3.1.alpha1 lib/table_cloth/configuration.rb