Sha256: e93717cb5610ced73f2a45302cb347f62c0272daaec997ff2195f1db00c5beaf

Contents?: true

Size: 907 Bytes

Versions: 2

Compression:

Stored size: 907 Bytes

Contents

module Pugin
	module Feature
		module Bandiera
			class << self
				def dissolution?
					get_features

					@features.fetch('show-dissolution', false)
				end
				def register_to_vote?
					get_features

					@features.fetch('show-register', false)
				end
				def election?
					get_features

					@features.fetch('show-election', false)
				end
				def post_election?
					get_features

					@features.fetch('show-post-election', false)
				end
				def show_list_images?
					get_features

					@features.fetch('show-list-images', false)
				end
				def show_committees?
					get_features

					@features.fetch('show-committees', false)
				end


				# Reset cached features
				def reset
					@features = nil
				end

				private

				# Get features if not already cached
				def get_features
					@features ||= Pugin::BANDIERA_CLIENT.get_features_for_group('parliament')
				end
			end
		end
	end 
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pugin-1.3.1 lib/pugin/feature/bandiera.rb
pugin-1.3.0 lib/pugin/feature/bandiera.rb