Class: SimpleContentManagement::SimpleMenuConfiguration

Inherits:
Object
  • Object
show all
Defined in:
app/models/simple_content_management/simple_menu_configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ SimpleMenuConfiguration

Returns a new instance of SimpleMenuConfiguration.



4
5
6
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 4

def initialize id
	@id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



2
3
4
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 2

def id
  @id
end

Class Method Details

.configure(&block) ⇒ Object



35
36
37
38
39
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 35

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


29
30
31
32
33
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 29

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

Instance Method Details

#condition(&set_condition) ⇒ Object



8
9
10
11
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 8

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

#default_label(set_default_label = nil) ⇒ Object



18
19
20
21
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 18

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


13
14
15
16
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 13

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

#name(set_name = nil) ⇒ Object



23
24
25
26
# File 'app/models/simple_content_management/simple_menu_configuration.rb', line 23

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