Sha256: 1bf45c9c96caa73b5b3c0baefad53f7a97500dc020507112f2481181e57a6ad3

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

module Inky
  # @return [Inky::Configuration] Inky's current configuration
  def self.configuration
    @configuration ||= Configuration.new
  end

  # Set Inky's configuration
  # @param config [Inky::Configuration]
  def self.configuration=(config)
    @configuration = config
  end

  # Modify Inky's current configuration
  # @yieldparam [Inky::Configuration] config current Inky config
  # ```
  # Inky.configure do |config|
  #   config.template_engine = :slim
  #   config.column_count = 24
  # end
  # ```
  def self.configure
    yield configuration
  end

  class Configuration
    attr_accessor :template_engine, :column_count

    def initialize
      @template_engine = :erb
      @column_count = 12
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
inky-rb-1.3.7.5 lib/inky/configuration.rb
inky-rb-1.3.7.4 lib/inky/configuration.rb
inky-rb-1.3.7.3 lib/inky/configuration.rb