Sha256: d235d8c627520bfcf7e9568e46908df10c2c762b1a6ef4c3cfea79f51b590d85

Contents?: true

Size: 527 Bytes

Versions: 325

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module EacRubyUtils
  module Immutable
    module ClassMethods
      def immutable_accessor(*accessors)
        options = accessors.extract_options!
        options[:type] ||= const_get('TYPE_COMMON')
        accessors.each do |name|
          class_name = options.fetch(:type).to_s.camelize + 'Accessor'
          ::EacRubyUtils::Immutable.const_get(class_name).new(name).apply(self)
        end
      end

      private

      def imutable_single_accessor(name, options); end
    end
  end
end

Version data entries

325 entries across 325 versions & 4 rubygems

Version Path
eac_tools-0.66.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.65.1 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_ruby_utils-0.116.0 lib/eac_ruby_utils/immutable/class_methods.rb
eac_ruby_utils-0.115.0 lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.65.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_ruby_utils-0.114.0 lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.64.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_ruby_utils-0.113.0 lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.63.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.62.1 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.62.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.61.1 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.61.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.60.3 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.60.2 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.60.1 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.60.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.59.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.58.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb
eac_tools-0.57.0 sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb