Sha256: de01a0f18405fce410e395ba1db872add25c49622a73f9448a3ff4d719d8b816

Contents?: true

Size: 896 Bytes

Versions: 4

Compression:

Stored size: 896 Bytes

Contents

module HoneyFormat
  # Holds HoneyFormat configuration
  # @attr_reader [#call] header_converter the configured header converter
  # @attr_reader [#call] converter the configured value converter
  # @attr_writer [#call] header_converter to use
  # @attr_writer [#call] converter the value converter to use
  class Configuration
    attr_accessor :header_converter, :converter

    # Instantiate configuration
    def initialize
      @converter = ValueConverter.new
      @header_converter = @converter[:header_column]
    end

    # Set the header converter
    # @param [Symbol, #call] converter for registered value converter or object that responds to #call
    # @return [#call] the header converter
    def header_converter=(converter)
      if converter.is_a?(Symbol)
        return @header_converter = @converter[converter]
      end
      @header_converter = converter
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
honey_format-0.16.0 lib/honey_format/configuration.rb
honey_format-0.15.0 lib/honey_format/configuration.rb
honey_format-0.14.0 lib/honey_format/configuration.rb
honey_format-0.13.0 lib/honey_format/configuration.rb