Class: Admin::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/admin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_requiredObject

Returns the value of attribute admin_required.



27
28
29
# File 'lib/admin.rb', line 27

def admin_required
  @admin_required
end

#nameObject

Returns the value of attribute name.



27
28
29
# File 'lib/admin.rb', line 27

def name
  @name
end

#pathObject

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

Returns:

  • (Boolean)


35
36
37
# File 'lib/admin.rb', line 35

def display_for?(moderator)
  admin_required ? moderator.admin? : true
end