Module: NTEE
- Defined in:
- lib/ntee.rb,
lib/ntee/version.rb,
lib/ntee/search_dimension.rb
Defined Under Namespace
Classes: Category, FlatDimension, FlatDimensionValue, HierarchicalDimension, HierarchicalDimensionValue
Constant Summary collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
-
.all_categories ⇒ Object
Returns the value of attribute all_categories.
-
.root_categories ⇒ Object
Returns the value of attribute root_categories.
Class Method Summary collapse
Class Attribute Details
.all_categories ⇒ Object
Returns the value of attribute all_categories.
86 87 88 |
# File 'lib/ntee.rb', line 86 def all_categories @all_categories end |
.root_categories ⇒ Object
Returns the value of attribute root_categories.
86 87 88 |
# File 'lib/ntee.rb', line 86 def root_categories @root_categories end |
Class Method Details
.add_category!(category) ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/ntee.rb', line 97 def add_category!(category) root_categories[category.code.to_s] = category if category.parent.nil? category.subcategories.each do |code, subcategory| add_category!(subcategory) end all_categories[category.code.to_s] = category end |