Class: AdminItem

Inherits:
Object show all
Defined in:
card/mod/core/lib/admin_item.rb

Overview

represents an entry in admin.yml

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#categoryObject (readonly)

Returns the value of attribute category.



3
4
5
# File 'card/mod/core/lib/admin_item.rb', line 3

def category
  @category
end

#codenameObject (readonly)

Returns the value of attribute codename.



3
4
5
# File 'card/mod/core/lib/admin_item.rb', line 3

def codename
  @codename
end

#modObject (readonly)

Returns the value of attribute mod.



3
4
5
# File 'card/mod/core/lib/admin_item.rb', line 3

def mod
  @mod
end

#rolesObject

Returns the value of attribute roles.



4
5
6
# File 'card/mod/core/lib/admin_item.rb', line 4

def roles
  @roles
end

#subcategoryObject (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

#titleObject



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