Sha256: cd8cccfa974d3d576c08c968f6b9d645dfffb654b7b3fae84683a54c1e9a6d72

Contents?: true

Size: 730 Bytes

Versions: 30

Compression:

Stored size: 730 Bytes

Contents

require 'pugin/feature/simple_feature'
require 'pugin/feature/status_banner'
require 'pugin/feature/global_search'
require 'pugin/feature/top_navigation'
require 'pugin/feature/pingdom_feature'
require 'pugin/feature/asset_overrides'
require 'pugin/feature/bandiera'

module Pugin
	module Feature
		def self.enable(feature)
			get_feature(feature)&.enable
		end

		def self.disable(feature)
			get_feature(feature)&.disable
		end

		private

		def self.get_feature(feature)
			# Does the feature passed exist?
			raise ArgumentError, "Feature #{feature} does not exist in Pugin. Please check your spelling and try again." unless constants.include?(feature.to_sym)

			Object.const_get("Pugin::Feature::#{feature}")
		end
	end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
pugin-1.9.3 lib/pugin/feature.rb
pugin-1.9.2 lib/pugin/feature.rb
pugin-1.9.1 lib/pugin/feature.rb
pugin-1.9.0 lib/pugin/feature.rb
pugin-1.8.9 lib/pugin/feature.rb
pugin-1.8.8 lib/pugin/feature.rb
pugin-1.8.7 lib/pugin/feature.rb
pugin-1.8.6 lib/pugin/feature.rb
pugin-1.8.5 lib/pugin/feature.rb
pugin-1.8.4 lib/pugin/feature.rb
pugin-1.8.3 lib/pugin/feature.rb
pugin-1.8.2 lib/pugin/feature.rb
pugin-1.8.0 lib/pugin/feature.rb
pugin-1.7.0 lib/pugin/feature.rb
pugin-1.6.23 lib/pugin/feature.rb
pugin-1.6.22 lib/pugin/feature.rb
pugin-1.6.21 lib/pugin/feature.rb
pugin-1.6.20 lib/pugin/feature.rb
pugin-1.6.19 lib/pugin/feature.rb
pugin-1.6.18 lib/pugin/feature.rb