Module: Hippo::Screen
- Extended by:
- Enumerable
- Defined in:
- lib/hippo/screen.rb,
lib/hippo/screen/group.rb,
lib/hippo/screen/definition.rb
Defined Under Namespace
Classes: Definition, DefinitionList, Group
Constant Summary
collapse
- GROUPS =
Hash.new{|h,k| g=Group.new; g.identifier=k; h[k]=g }
- DEFINITIONS =
Hash.new
- EXTENSIONS =
Hash.new
Class Method Summary
collapse
Class Method Details
.[](config) ⇒ Object
49
50
51
52
53
54
55
|
# File 'lib/hippo/screen.rb', line 49
def [](config)
if DEFINITIONS.key?(config)
DEFINITIONS[config]
else
nil
end
end
|
.config_file ⇒ Object
84
85
86
|
# File 'lib/hippo/screen.rb', line 84
def config_file
Hippo::Extensions.controlling.root_path.join("config", "screens.rb")
end
|
.define_group(id) {|group| ... } ⇒ Object
67
68
69
70
|
# File 'lib/hippo/screen.rb', line 67
def define_group(id)
group = GROUPS[id]
yield group
end
|
.each ⇒ Object
57
58
59
|
# File 'lib/hippo/screen.rb', line 57
def each
DEFINITIONS.values.each { |s| yield s }
end
|
.for_extension(id) {|definition| ... } ⇒ Object
61
62
63
64
65
|
# File 'lib/hippo/screen.rb', line 61
def for_extension(id)
definition = EXTENSIONS[id] ||= DefinitionList.new(id)
yield definition if block_given?
definition
end
|
.ids_for_user(user) ⇒ Object