Sha256: 62936fa6c60d448bb3e61a017cdb64bd8eba44ce75ff144fe09f4ee9ac74da92

Contents?: true

Size: 571 Bytes

Versions: 4

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true

module EnumIsh
  class Config
    class_attribute :data

    self.data = {
      defaults: { text: true, options: true },
      text_prefix: '',
      text_suffix: '_text',
      options_prefix: '',
      options_suffix: '_options',
      raw_prefix: '',
      raw_suffix: '_raw',
      scope_prefix: 'with_',
      scope_suffix: ''
    }

    data.keys.each do |key|
      define_singleton_method "#{key}" do
        data[key]
      end

      define_singleton_method "#{key}=" do |val|
        data[key] = val
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enum_ish-1.6.3 lib/enum_ish/config.rb
enum_ish-1.6.2 lib/enum_ish/config.rb
enum_ish-1.6.1 lib/enum_ish/config.rb
enum_ish-1.6.0 lib/enum_ish/config.rb