Sha256: 2fe72408649f35487ab07780cb6fbf8e21fdb8243d855befc3ec02b31cad6e53

Contents?: true

Size: 825 Bytes

Versions: 7

Compression:

Stored size: 825 Bytes

Contents

class SimpleContentManagement::SimpleMenuConfiguration
	attr_accessor :id

	def initialize id
		@id = id
	end

	def condition &set_condition
		@condition = set_condition unless set_condition.nil?
		@condition
	end

	def link &set_link
		@link = set_link unless set_link.nil?
		@link
	end

	def default_label set_default_label = nil
		@name = set_default_label unless set_default_label.nil?
		@name
	end

	def name set_name = nil
		@name = set_name unless set_name.nil?
		@name
	end

	class << self
		def menu_item id, &block
			smc = SimpleContentManagement::SimpleMenuConfiguration.new id
			smc.instance_eval &block
			@registered_menu_items << smc
		end

		def configure &block
			@registered_menu_items = []
			SimpleContentManagement::SimpleMenuConfiguration.instance_eval &block
			@registered_menu_items
		end
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
th_simple_content_management-0.2.7 app/models/simple_content_management/simple_menu_configuration.rb
th_simple_content_management-0.2.6 app/models/simple_content_management/simple_menu_configuration.rb
th_simple_content_management-0.2.5 app/models/simple_content_management/simple_menu_configuration.rb
th_simple_content_management-0.2.4 app/models/simple_content_management/simple_menu_configuration.rb
th_simple_content_management-0.2.3 app/models/simple_content_management/simple_menu_configuration.rb
th_simple_content_management-0.2.2 app/models/simple_content_management/simple_menu_configuration.rb
th_simple_content_management-0.2.1 app/models/simple_content_management/simple_menu_configuration.rb