Class: AdminItem
Overview
represents an entry in admin.yml
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#codename ⇒ Object
readonly
Returns the value of attribute codename.
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
-
#roles ⇒ Object
Returns the value of attribute roles.
-
#subcategory ⇒ Object
readonly
Returns the value of attribute subcategory.
Instance Method Summary collapse
-
#initialize(mod, category, subcategory, codename) ⇒ AdminItem
constructor
A new instance of AdminItem.
-
#title ⇒ Object
Constructor Details
#initialize(mod, category, subcategory, codename) ⇒ AdminItem
Returns a new instance of AdminItem.
6 7 8 9 10 11 |
# File 'card/mod/core/lib/admin_item.rb', line 6 def initialize mod, category, subcategory, codename @mod = mod @category = category @subcategory = subcategory @codename = codename end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
3 4 5 |
# File 'card/mod/core/lib/admin_item.rb', line 3 def category @category end |
#codename ⇒ Object (readonly)
Returns the value of attribute codename.
3 4 5 |
# File 'card/mod/core/lib/admin_item.rb', line 3 def codename @codename end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
3 4 5 |
# File 'card/mod/core/lib/admin_item.rb', line 3 def mod @mod end |
#roles ⇒ Object
Returns the value of attribute roles.
4 5 6 |
# File 'card/mod/core/lib/admin_item.rb', line 4 def roles @roles end |
#subcategory ⇒ Object (readonly)
Returns the value of attribute subcategory.
3 4 5 |
# File 'card/mod/core/lib/admin_item.rb', line 3 def subcategory @subcategory end |
Instance Method Details
#title ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'card/mod/core/lib/admin_item.rb', line 13 def title config_titles = Card::Set::All::Admin.basket[:config_title] if subcategory config_titles[subcategory.to_sym] || subcategory.capitalize else config_titles[category.to_sym] || category.capitalize end end |