Module: Hub::Data

Defined in:
lib/hub/data.rb

Defined Under Namespace

Classes: Data

Constant Summary

CONFIG_DATA =

The raw YAML (Hash)

YAML.load_file(Rails.root + 'config/interface/hub/data.yml')
SECTIONS =
CONFIG_DATA.keys
INDEX =

A Hash of prefix => UserTasks::UserTask

data
BY_NAME =
by_name

Class Method Summary (collapse)

Class Method Details

+ (Object) items_for(section)



105
106
107
# File 'lib/hub/data.rb', line 105

def self.items_for(section)
  INDEX[section]
end

Returns translate a related prefix into a name string if present, else return the string as is

Returns:

  • (String)

    translate a related prefix into a name string if present, else return the string as is



115
116
117
118
119
120
121
# File 'lib/hub/data.rb', line 115

def self.related_name(prefix)
  if t = INDEXED_TASKS[prefix]
    t.name
  else
    prefix
  end 
end


123
124
125
# File 'lib/hub/data.rb', line 123

def self.related_routes(prefix)
  INDEXED_TASKS[prefix].related
end

+ (Object) visual_items_for(section)



109
110
111
# File 'lib/hub/data.rb', line 109

def self.visual_items_for(section)
  INDEX[section].select{|a| !a.hide}
end