Sha256: 9e939cbc28faa1b4382e610a144e2fb413ad6f458bbc6a97c9a7a2a14d5317d1

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

module EnumIsh
  class Config
    class_attribute :data

    self.data = {
      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

2 entries across 2 versions & 1 rubygems

Version Path
enum_ish-1.5.1 lib/enum_ish/config.rb
enum_ish-1.5.0 lib/enum_ish/config.rb