Module: Hub::Data
- Defined in:
- lib/hub/data.rb
Defined Under Namespace
Classes: Data
Constant Summary collapse
- 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
- .items_for(section) ⇒ Object
-
.related_name(prefix) ⇒ String
Translate a related prefix into a name string if present, else return the string as is.
- .related_routes(prefix) ⇒ Object
- .visual_items_for(section) ⇒ Array
Class Method Details
.items_for(section) ⇒ Object
116 117 118 |
# File 'lib/hub/data.rb', line 116 def self.items_for(section) INDEX[section] end |
.related_name(prefix) ⇒ String
Returns translate a related prefix into a name string if present, else return the string as is.
129 130 131 132 133 134 135 |
# File 'lib/hub/data.rb', line 129 def self.(prefix) if t = INDEXED_TASKS[prefix] t.name else prefix end end |
.related_routes(prefix) ⇒ Object
139 140 141 |
# File 'lib/hub/data.rb', line 139 def self.(prefix) INDEXED_TASKS[prefix]. end |
.visual_items_for(section) ⇒ Array
122 123 124 |
# File 'lib/hub/data.rb', line 122 def self.visual_items_for(section) INDEX[section].select{|a| !a.hide}.sort_by(&:name) end |