Class: Cmtool::Menu::ElementBase
- Inherits:
-
Object
- Object
- Cmtool::Menu::ElementBase
show all
- Defined in:
- lib/cmtool/menu.rb
Overview
Base class for elements in the menu. All elements like Groups/ResourceLinks should inherit from this class
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ElementBase.
34
35
36
|
# File 'lib/cmtool/menu.rb', line 34
def initialize(*args)
@options = args.
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
46
47
48
49
50
|
# File 'lib/cmtool/menu.rb', line 46
def method_missing(*args)
return true if self.class.name.sub(/.*::/, '').underscore.concat("?") == args.first.to_s
return false if args.first.to_s.last == '?'
@register.send(*args)
end
|
Instance Method Details
#controller_name ⇒ Object
40
41
42
|
# File 'lib/cmtool/menu.rb', line 40
def controller_name
''
end
|
#controller_names ⇒ Object
37
38
39
|
# File 'lib/cmtool/menu.rb', line 37
def controller_names
[]
end
|
#engine_link? ⇒ Boolean
52
53
54
|
# File 'lib/cmtool/menu.rb', line 52
def engine_link?
false
end
|
#options ⇒ Object
43
44
45
|
# File 'lib/cmtool/menu.rb', line 43
def options
@options ||= {}
end
|
#resource_link? ⇒ Boolean
56
57
58
|
# File 'lib/cmtool/menu.rb', line 56
def resource_link?
false
end
|