Module: Lanes::Screen

Extended by:
Enumerable
Defined in:
lib/lanes/screen.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 =

{|h,k| d=Definition.new; d.identifier=k; h=d }

Hash.new

Class Method Summary collapse

Class Method Details

.[](config) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/lanes/screen.rb', line 27

def [](config)
    if DEFINITIONS.key?(config)
        DEFINITIONS[config]
    else
        nil
    end
end

.config_fileObject



54
55
56
# File 'lib/lanes/screen.rb', line 54

def config_file
    Lanes::Extensions.controlling.root_path.join("config", "screens.rb")
end

.define_group(id) {|group| ... } ⇒ Object

Yields:

  • (group)


39
40
41
42
# File 'lib/lanes/screen.rb', line 39

def define_group(id)
    group = GROUPS[id]
    yield group
end

.eachObject



44
45
46
47
# File 'lib/lanes/screen.rb', line 44

def each
    Extensions.load_screens
    DEFINITIONS.values.each{ | definition | yield definition }
end

.each_groupObject



49
50
51
52
# File 'lib/lanes/screen.rb', line 49

def each_group
    Extensions.load_screens
    GROUPS.values.each{ | group | yield group }
end

.for_extension(id) {|DefinitionList.new(id)| ... } ⇒ Object

Yields:



35
36
37
# File 'lib/lanes/screen.rb', line 35

def for_extension(id)
    yield DefinitionList.new(id)
end