Sha256: 5d44105003b5b620524a9fc1161aa3680b9857edbbc41daf105bb07a9021cfb9

Contents?: true

Size: 691 Bytes

Versions: 15

Compression:

Stored size: 691 Bytes

Contents

require 'pugin/feature/simple_feature'
require 'pugin/feature/status_banner'
require 'pugin/feature/global_search'
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

15 entries across 15 versions & 1 rubygems

Version Path
pugin-1.10.10 lib/pugin/feature.rb
pugin-1.10.9 lib/pugin/feature.rb
pugin-1.10.8 lib/pugin/feature.rb
pugin-1.10.7 lib/pugin/feature.rb
pugin-1.10.6 lib/pugin/feature.rb
pugin-1.10.5 lib/pugin/feature.rb
pugin-1.10.4 lib/pugin/feature.rb
pugin-1.10.3 lib/pugin/feature.rb
pugin-1.10.2 lib/pugin/feature.rb
pugin-1.10.1 lib/pugin/feature.rb
pugin-1.10.0 lib/pugin/feature.rb
pugin-1.9.7 lib/pugin/feature.rb
pugin-1.9.6 lib/pugin/feature.rb
pugin-1.9.5 lib/pugin/feature.rb
pugin-1.9.4 lib/pugin/feature.rb