Class: Sidebar
- Inherits:
-
Object
- Object
- Sidebar
- Defined in:
- app/models/sidebar.rb
Instance Attribute Summary collapse
-
#contexts ⇒ Object
readonly
Returns the value of attribute contexts.
-
#projects ⇒ Object
readonly
Returns the value of attribute projects.
Instance Method Summary collapse
- #active_contexts ⇒ Object
- #active_projects ⇒ Object
- #completed_projects ⇒ Object
- #hidden_contexts ⇒ Object
- #hidden_projects ⇒ Object
-
#initialize(user) ⇒ Sidebar
constructor
A new instance of Sidebar.
Constructor Details
#initialize(user) ⇒ Sidebar
Returns a new instance of Sidebar.
4 5 6 7 8 |
# File 'app/models/sidebar.rb', line 4 def initialize(user) user = user @contexts = user.contexts @projects = user.projects end |
Instance Attribute Details
#contexts ⇒ Object (readonly)
Returns the value of attribute contexts.
2 3 4 |
# File 'app/models/sidebar.rb', line 2 def contexts @contexts end |
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
2 3 4 |
# File 'app/models/sidebar.rb', line 2 def projects @projects end |
Instance Method Details
#active_contexts ⇒ Object
10 11 12 |
# File 'app/models/sidebar.rb', line 10 def active_contexts @active_contexts ||= contexts.active end |
#active_projects ⇒ Object
18 19 20 |
# File 'app/models/sidebar.rb', line 18 def active_projects @active_projects ||= projects.active end |
#completed_projects ⇒ Object
26 27 28 |
# File 'app/models/sidebar.rb', line 26 def completed_projects @completed_projects ||= projects.completed end |
#hidden_contexts ⇒ Object
14 15 16 |
# File 'app/models/sidebar.rb', line 14 def hidden_contexts @hidden_contexts ||= contexts.hidden end |
#hidden_projects ⇒ Object
22 23 24 |
# File 'app/models/sidebar.rb', line 22 def hidden_projects @hidden_projects ||= projects.hidden end |