Sha256: c4e353b07213e9bde3abdab8cde0edeaa03e7d1bef59bdefe4df813c1a9b1ba4

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

module Flexparser
  #
  # Class to keep config-options for the whole module.
  #
  class Configuration
    AVAILABLE_OPTIONS =
      %i[retry_without_namespaces explicit_property_naming].freeze
    attr_accessor(*AVAILABLE_OPTIONS)

    def initialize
      set_defaults
    end

    def to_h
      Hash[AVAILABLE_OPTIONS.map { |o| [o, public_send(o)] }]
    end

    def set_defaults
      @retry_without_namespaces = true
      @explicit_property_naming = true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flexparser-1.0.3 lib/flexparser/configuration.rb
flexparser-1.0.2 lib/flexparser/configuration.rb