Sha256: d05678ce98270b11dd2bc439d795eeef91d754c5fe0462cfbf9881e9f370cf3b

Contents?: true

Size: 678 Bytes

Versions: 11

Compression:

Stored size: 678 Bytes

Contents

module Spree
  module Core
    module EnvironmentExtension
      extend ActiveSupport::Concern

      def add_class(name)
        ActiveSupport::Deprecation.warn(<<-EOS, caller)
          EnvironmentExtension module is deprecated and will be removed in Spree 3.6
        EOS
        instance_variable_set "@#{name}", Set.new

        create_method("#{name}=".to_sym) do |val|
          instance_variable_set('@' + name, val)
        end

        create_method(name.to_sym) do
          instance_variable_get('@' + name)
        end
      end

      private

      def create_method(name, &block)
        self.class.send(:define_method, name, &block)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_core-3.6.6 lib/spree/core/environment_extension.rb
spree_core-3.6.5 lib/spree/core/environment_extension.rb
spree_core-3.6.4 lib/spree/core/environment_extension.rb
spree_core-3.6.3 lib/spree/core/environment_extension.rb
spree_core-3.6.2 lib/spree/core/environment_extension.rb
spree_core-3.6.1 lib/spree/core/environment_extension.rb
spree_core-3.6.0 lib/spree/core/environment_extension.rb
spree_core-3.5.0 lib/spree/core/environment_extension.rb
spree_core-3.6.0.rc1 lib/spree/core/environment_extension.rb
spree_core-3.5.0.rc2 lib/spree/core/environment_extension.rb
spree_core-3.5.0.rc1 lib/spree/core/environment_extension.rb