Class: Admin::Tab
- Inherits:
-
Object
- Object
- Admin::Tab
- Defined in:
- lib/admin.rb
Instance Attribute Summary collapse
-
#admin_required ⇒ Object
Returns the value of attribute admin_required.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #display_for?(moderator) ⇒ Boolean
-
#initialize(str_name, str_path, bool_admin_required) ⇒ Tab
constructor
A new instance of Tab.
Constructor Details
#initialize(str_name, str_path, bool_admin_required) ⇒ Tab
Returns a new instance of Tab.
29 30 31 32 33 |
# File 'lib/admin.rb', line 29 def initialize(str_name,str_path,bool_admin_required) @name = str_name.to_s @path = str_path.to_s @admin_required = bool_admin_required ? true : false end |
Instance Attribute Details
#admin_required ⇒ Object
Returns the value of attribute admin_required.
27 28 29 |
# File 'lib/admin.rb', line 27 def admin_required @admin_required end |
#name ⇒ Object
Returns the value of attribute name.
27 28 29 |
# File 'lib/admin.rb', line 27 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
27 28 29 |
# File 'lib/admin.rb', line 27 def path @path end |
Instance Method Details
#display_for?(moderator) ⇒ Boolean
35 36 37 |
# File 'lib/admin.rb', line 35 def display_for?(moderator) admin_required ? moderator.admin? : true end |