Class: Sidebar

Inherits:
Object
  • Object
show all
Defined in:
app/models/sidebar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contextsObject (readonly)

Returns the value of attribute contexts.



2
3
4
# File 'app/models/sidebar.rb', line 2

def contexts
  @contexts
end

#projectsObject (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_contextsObject



10
11
12
# File 'app/models/sidebar.rb', line 10

def active_contexts
  @active_contexts ||= contexts.active
end

#active_projectsObject



18
19
20
# File 'app/models/sidebar.rb', line 18

def active_projects
  @active_projects ||= projects.active
end

#completed_projectsObject



26
27
28
# File 'app/models/sidebar.rb', line 26

def completed_projects
  @completed_projects ||= projects.completed
end

#hidden_contextsObject



14
15
16
# File 'app/models/sidebar.rb', line 14

def hidden_contexts
  @hidden_contexts ||= contexts.hidden
end

#hidden_projectsObject



22
23
24
# File 'app/models/sidebar.rb', line 22

def hidden_projects
  @hidden_projects ||= projects.hidden
end