Class: MetaRuby::GUI::ModelHierarchy::Metadata
- Inherits:
-
Struct
- Object
- Struct
- MetaRuby::GUI::ModelHierarchy::Metadata
- Defined in:
- lib/metaruby/gui/model_hierarchy.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#name ⇒ Object
Returns the value of attribute name.
-
#search_key ⇒ Object
Returns the value of attribute search_key.
Instance Method Summary collapse
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories
4 5 6 |
# File 'lib/metaruby/gui/model_hierarchy.rb', line 4 def categories @categories end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/metaruby/gui/model_hierarchy.rb', line 4 def name @name end |
#search_key ⇒ Object
Returns the value of attribute search_key
4 5 6 |
# File 'lib/metaruby/gui/model_hierarchy.rb', line 4 def search_key @search_key end |
Instance Method Details
#merge(other) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/metaruby/gui/model_hierarchy.rb', line 5 def merge(other) a, b = search_key, other.search_key.dup if a.size < b.size a, b = b, a end b.size.times do |i| a[i] |= b[i] end self.search_key = a self.categories = categories | other.categories end |
#to_user_role ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/metaruby/gui/model_hierarchy.rb', line 17 def to_user_role categories = self.categories.to_a.join(",") search_key = self.search_key.map do |level_keys| level_keys.join(",") end.join(",;,") ",#{categories},;,#{search_key}," end |